FatMouse's Speed(HDU LIS)】的更多相关文章

FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13133    Accepted Submission(s): 5778Special Judge Problem Description FatMouse believes that the fatter a mouse is, the faster i…
      #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; #define met(a,b) (memset(a,b,sizeof(a))) #define N 1100 #define INF 0xffffff struct node { int w, s, nu…
参考:https://blog.csdn.net/u012655441/article/details/64920825 https://blog.csdn.net/wy19910326/article/details/7232308 https://blog.csdn.net/weizhuwyzc000/article/details/45823031 #include <iostream> #include <cstdio> #include <cstring> #…
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the speed…
题目大意:   给n*n地图,老鼠初始位置在(0,0),它每次行走要么横着走要么竖着走,每次最多可以走出k个单位长度,且落脚点的权值必须比上一个落脚点的权值大,求最终可以获得的最大权值   (题目很容易会理解错题意,道友小心) #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace…
//1088(参考博客:http://blog.csdn.net/libin56842/article/details/8950688)//1.编写一个浏览器输入输出(hdu acm1088)://思路:对已经输入的字符串进行处理,遇到<br><hr>分别进行处理.遇到多于80个字符(统计该行的长度)或者<br>或者结束,则换行:遇到<hr>,输出80个'-'.#include<stdio.h>#include<string.h>#d…
2021.12.06 P2501 [HAOI2006]数字序列(动态规划+LIS) https://www.luogu.com.cn/problem/P2501 题意: 现在我们有一个长度为 n 的整数序列 a.但是它太不好看了,于是我们希望把它变成一个单调严格上升的序列.但是不希望改变过多的数,也不希望改变的幅度太大. 求最小的改变次数和此时每个数改变的绝对值之和. 分析: 对于 \(a_i\) ,\(a_j\) , \(i<j\) ,当 \(j-i<=a_j-a_i\) 时 \(i\) 与…
Problem Description FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are incre…
FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14980    Accepted Submission(s): 6618 Special Judge Problem Description FatMouse believes that the fatter a mouse is, the faster…
FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20803    Accepted Submission(s): 9227Special Judge Problem Description FatMouse believes that the fatter a mouse is, the faster…
FatMouse's Speed Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24573    Accepted Submission(s): 10896Special Judge Problem Description FatMouse believes that the fatter a mouse is, the faster…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5064 题目意思:给出n个数:a1, a2, ..., an,然后需要从中找出一个最长的序列 b1, b2, ...,  bt.需要满足两个条件(1)b1≤b2≤…≤bt   (2)b2−b1≤b3−b2≤⋯≤bt−bt−1.求出最大的 t 为多少. 遗留大半年的题目呀呀呀呀~~~~!!!首先非常感谢乌冬子大半年前的指点迷津,呕心沥血想了大半天举出个反例,以便指出我算法的错误.为了纪念这个伟大的人物(…
http://acm.hdu.edu.cn/showproblem.php?pid=4605 Magic Ball Game Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 309    Accepted Submission(s): 73 Problem Description When the magic ball game tu…
http://acm.hdu.edu.cn/showproblem.php?pid=2686     Problem Description Yifenfei very like play a number game in the n*n Matrix. A positive integer number is put in each area of the Matrix.Every time yifenfei should to do is that choose a detour which…
http://acm.hdu.edu.cn/showproblem.php?pid=3345 Problem Description War chess is hh's favorite game:In this game, there is an N * M battle map, and every player has his own Moving Val (MV). In each round, every player can move in four directions as lo…
为迎接9月14号hdu命题的长春网络赛 ACM弱校的弱菜,苦逼的在机房(感谢有你)呻吟几声: 1.对于本次网络赛,本校一共6名正式队员,训练靠的是完全的自主学习意识 2.对于网络赛的群殴模式,想竞争现场赛名额,只有泪奔%>_<% 3.至于带队教练的请师兄帮帮忙,如果可以的活,他们能在训练过程中指导,岂不更好,个人对此表示不乐观 虽然形式很不乐观,但我们还是努力着,尽人事,然后…… 至于最终结果拭目以待吧 o(╯□╰)o 杭电上的题目 4267 A Simple Problem with Int…
Baby Ming and Weight lifting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 681    Accepted Submission(s): 280 Problem Description Baby Ming is fond of weight lifting. He has a barbell pole(the…
geometry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 340    Accepted Submission(s): 256 Problem Description There is a point P at coordinate (x,y).A line goes through the point, and intersec…
Warm up 2 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 243    Accepted Submission(s): 108 Problem Description Some 1×2 dominoes are placed on a plane. Each dominoe is placed either horizonta…
Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况.由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视. 中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少…
Problem Description "You shall not pass!" After shouted out that,the Force Staff appered in CaoHaha's hand. As we all know,the Force Staff is a staff with infinity power.If you can use it skillful,it may help you to do whatever you want. But now…
题意: FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence so that the weights are increasing, but the s…
点我看题目 题意 :给你好多只老鼠的体重和速度,第 i 行代表着第 i 个位置上的老鼠,让你找出体重越大速度越慢的老鼠,先输出个数,再输出位置. 思路 :看题的时候竟然脑子抽风了,看了好久愣是没明白题目是什么意思.其实就是先按照体重排序,然后在速度里边找最长下降子序列,记录一下他们原来的位置,输出就行.数组开小了还WA了一次 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <i…
又是那个lis变形的题目. 但是不好定义严格的比较符号,因此只能n^2去做.值得注意的一个是要先排序,因为可能可以先选后面的再选前面的,先排序的话就能够避免这个问题.但是要注意,因为要输出路径,所以要记录之前的id. 代码如下: #include <stdio.h> #include <algorithm> #include <string.h> #include <stack> using namespace std; + ; const int inf…
题意:给定一个长度为n的序列,让你求一个和最大递增序列. 析:一看,是不是很像LIS啊,这基本就是一样的,只不过改一下而已,d(i)表示前i个数中,最大的和并且是递增的, 如果 d(j) + a[i] > d(i)  d(i) = d(j) + a[i] (这是保证和最大),那么怎么是递增呢?很简单嘛,和LIS一样 再加上a[i] > a[j],这不就OK了. 代码如下: #include <cstdio> #include <iostream> #include &l…
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 41982    Accepted Submission(s): 13962 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats g…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1160 FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequen…
http://acm.hdu.edu.cn/showproblem.php?pid=5773 The All-purpose Zero Problem Description   ?? gets an sequence S with n intergers(0 < n <= 100000,0<= S[i] <= 1000000).?? has a magic so that he can change 0 to any interger(He does not need to ch…
N*N的矩阵,每个格子上有一个值. 老鼠起始在(1,1),每次只能水平着走或垂直着走.且最多只能走K步.且走到的格子里的值必须比上一次呆的格子里的值大. 问老鼠最多收集到多少值. 思路: 记忆搜好写.方便. 注意边界 代码: int n,k; int a[105][105]; int dp[105][105]; int dfs(int x,int y){ if(dp[x][y]>0) return dp[x][y]; for(int i=x+1;i<=min(n,x+k);++i){ if(a…
Problem Description In computer science, the longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to highest, and in which the subsequence is as long as po…