怒刷DP之 HDU 1087】的更多相关文章

Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Appoint description:  System Crawler  (2015-09-05) Description Nowadays, a kind of chess game called “Super…
最少拦截系统 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1257 Appoint description:  System Crawler  (2015-09-07) Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都…
FatMouse's Speed Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1160 Appoint description:  prayerhgq  (2015-07-28) System Crawler  (2015-09-05) Description FatMouse believes that the fatter a m…
Tickets Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1260 Appoint description:  System Crawler  (2015-09-06) Description Jesus, what a great movie! Thousands of people are rushing to the cine…
免费馅饼 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1176 Appoint description:  prayerhgq  (2015-07-28) System Crawler  (2015-09-05) Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼.说来ga…
Piggy-Bank Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1114 Appoint description:  System Crawler  (2015-09-06) Description Before ACM can do anything, a budget must be prepared and the neces…
Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Appoint description:  prayerhgq  (2015-08-04) System Crawler  (2015-09-05) Description A group of researchers are designing…
Max Sum Plus Plus Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1024 Appoint description:  System Crawler  (2015-09-05) Description Now I think you have got an AC in Ignatius.L's "Max Sum&…
Ignatius and the Princess IV Time Limit:1000MS     Memory Limit:32767KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1029 Appoint description:  jehad  (2014-05-27) gscsdlz  (2015-04-14) System Crawler  (2015-09-05) Description "OK…
HDU 1078 Super Jumping! Jumping! Jumping! 题意: 有这么个游戏,从start到end(自己决定在哪停下来)连续跳圈,中间不能空一个圈不跳,圈里的数字必须比你上次跳到圈里的数字大,最后求你所有路过的圈中数字总和最大. 思路:很明显的最长上升子序列之和,状态方程就是: dp[i] = max(dp[i],dp[j]+a[i])(a[i]>a[j],且i>j,dp[i]是i当前最优状态) /** Sample Input 3 1 3 2 4 1 2 3 4…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 33384    Accepted Submission(s): 15093 Problem Description Nowadays, a kind of chess game called “Super Jumping!…
H - Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Appoint description:  System Crawler  (2015-11-18) Description Nowadays, a kind of chess game called “Su…
动态规划就是寻找最优解的过程 最重要的是找到关系式 hdu 1003 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1003 题目大意:求最大字序列和,其实就是分成 以0结尾的序列 以1结尾的序列 以2结尾的序列 ... 以n结尾的序列 所以以n结尾的序列的最大值就是以n-1结尾的序列的最大值+n的值 或最大值是n的值 关系式: d[i]=max(d[i-1]+a[i],a[i]) d[i]为以i结尾的序列和的最大值,a[i]为第i个数的值 #in…
HDU 1087 题目大意:给定一个序列,只能走比当前位置大的位置,不可回头,求能得到的和的最大值.(其实就是求最大上升(可不连续)子序列和) 解题思路:可以定义状态dp[i]表示以a[i]为结尾的上升子序列的和的最大值,那么便可以得到状态转移方程 dp[i] = max(dp[i], dp[j]+a[i]), 其中a[j]<a[i]且j<i; 另外每个dp[i]可以先初始化为a[i] 理解:以a[i]为结尾的上升子序列可以由前面比a[i]小的某个序列加上a[i]来取得,故此有dp[j]+a[…
http://acm.hdu.edu.cn/showproblem.php?pid=1087   Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Description Nowadays, a kind of chess game called “Super Ju…
Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Appoint description:  System Crawler  (2017-04-13) Description Nowadays, a kind of chess game called “Super…
Description 魏总,也就是DP魏又开始刷DP了.一共有n道题,第i道题魏总原本需要u[i]秒的时间.不过,为了表达对这些水题的藐视,魏总决定先睡k秒再开始刷题.魏总并不清楚自己会睡多久,只知道k是不超过m的正实数.并且魏总还忘了这节课有多长,只记得这节课的长度T(单位:秒)是在L到R之间.(魏总是从开始上课的时候开始睡的)睡醒后,魏总神奇地发现自己做每道题所需的时间变成了原来的k倍.不过DP魏就是DP魏,他可以同时做这n道DP,互不影响. 魏总本想虐场,但他很快发现自己低估这些题了.于…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24452    Accepted Submission(s): 10786 Problem Description No…
http://acm.hdu.edu.cn/showproblem.php?pid=1087 设dp[i]表示去到这个位置时的最大和值.(就是以第i个为结尾的时候的最大值) 那么只要扫描一遍dp数组,就能得到ans,因为最后一步可以无条件到达终点. 那么可以用O(n^2)转移,枚举每一个位置,其中要初始化dp值,dp[i] = a[i],意思就是到达第i个位置的时候,和值最小也是 a[i]把,因为无论如何也可以一步到达a[i]这个值. #include <cstdio> #include &l…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 ---------------------------------------------------------------------------------------------------------------------------------------------------------- 欢迎光临天资小屋:http://user.qzone.qq.com/593830943…
Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game can be played by two or more than two…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34052    Accepted Submission(s): 15437 Problem Description Nowadays, a kind of chess game called “Super Jumping!…
C - Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, a…
Problem Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game can be played by two or more t…
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. The game can be played by two or more than two players. It consi…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23328    Accepted Submission(s): 10266 Problem Description Nowadays, a kind of chess game called “Super Jumping!…
解题思路:题目的大意是给出一列数,求这列数里面最长递增数列的和 dp[i]表示到达地点i的最大值,那么是如何达到i的呢,则我们可以考虑没有限制条件时候的跳跃,即可以从第1,2,3,---,i-1个地点跳跃到i, 而题目限定了,跳到的那个点的数要比开始跳的那个点的数大 所以,状态转移方程式为 for(i=1;i<=n;i++)   for(j=0;j<i;j++) if(a[j]>a[i])   dp[i]=max(dp[j]+a[i],dp[i]);//找出到达地点i的最大值 反思:本来…
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 47017    Accepted Submission(s): 21736 Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Ju…
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 56910    Accepted Submission(s): 26385 Problem Description Nowadays, a kind of chess game called “Super Jumping!…
DP基础题 DP[i]表示以a[i]结尾所能得到的最大值 但是a[n-1]不一定是整个序列能得到的最大值 #include <bits/stdc++.h> using namespace std; ; int dp[maxn],n,a[maxn]; int main() { while(scanf("%d",&n)&&n) { memset(dp,,sizeof(dp)); ;i<n;i++) scanf("%d",&…