Max SumProblem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,...
分类:
其他好文 时间:
2015-03-05 19:19:15
阅读次数:
161
dp是竞赛中常见的问题,也是我的弱项orz,更要多加练习。看到邝巨巨的dp专题练习第一道是Max Sum Plus Plus,所以我顺便把之前做过的hdu1003 Max Sum拿出来又做了一遍HDU 1003 Max Sum题目链接:http://acm.hdu.edu.cn/showproble...
分类:
其他好文 时间:
2015-02-26 21:37:15
阅读次数:
254
【思路】:把吃糖的行为看成是两两消除的行为,所以如果想全部消除,取决于数量最多的那种。所以得出公式:max - (sum-max)另外:要采用longlong型。
【AC代码】:
#include
#include
#include
#include
#include
#include
using namespace std;
#define MAX 1000000+10
in...
分类:
其他好文 时间:
2015-02-24 17:32:01
阅读次数:
122
Time Limit:1000MSMemory Limit:32768KBDescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For...
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll __int64
#define INF 0x3fffffff
using namespace std;
struct Node
{
int l,r;
int Max,Sum;
...
分类:
其他好文 时间:
2015-02-21 09:44:35
阅读次数:
165
http://acm.hdu.edu.cn/showproblem.php?pid=1003给出一个包含n个数字的序列{a1,a2,..,ai,..,an},-1000# define INF 1000000000int main(){ int Start, End, Sum, Max, Num, ...
分类:
其他好文 时间:
2015-02-20 18:38:19
阅读次数:
361
DescriptionInput输入文件的第1行包含两个数N和M,N表示初始时数列中数的个数,M表示要进行的操作数目。第2行包含N个数字,描述初始时的数列。以下M行,每行一条命令,格式参见问题描述中的表格。Output对于输入数据中的GET-SUM和MAX-SUM操作,向输出文件依次打印结果,每个答...
分类:
其他好文 时间:
2015-02-16 20:54:04
阅读次数:
241
Max Sum Plus Plus
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 18190 Accepted Submission(s): 5955Problem Description
Now I think you ha...
分类:
其他好文 时间:
2015-02-13 23:44:20
阅读次数:
374
Problem Description
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.
Given a consecutive number sequence S1, S...
分类:
其他好文 时间:
2015-02-08 09:09:37
阅读次数:
188