Problem 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,5,4,-7)...
分类:
其他好文 时间:
2015-04-24 12:29:58
阅读次数:
166
用long long竟然会超时
思路参考kuangbin的
因为n有1000000,可以用滚动数组
然后dp[i][j]表示选取第i个数,分成j组时的最大值
然后这里有一个比较独特的思路
一般的思路都是该数选或不选这两个状态,而这里不需要不选这个状态,不选的状态可以由
还要注意一点,这里i
//以前做过一些dp的题目,但都是一些很难的,基础没打好来,回来好好做一些基础dp
//其实做...
分类:
其他好文 时间:
2015-04-22 15:16:44
阅读次数:
80
先粘题目Max SumTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 167166Accepted Submission(s): 39004Prob...
分类:
其他好文 时间:
2015-04-22 13:32:56
阅读次数:
127
Problem Description
Given 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,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +...
分类:
其他好文 时间:
2015-04-22 11:36:55
阅读次数:
137
1 #include 2 typedef struct SU_tag{ 3 SU_tag(){} 4 SU_tag(int a,int b,int c):max_sum(a),left(b),right(c){} 5 int max_sum; 6 int left...
分类:
其他好文 时间:
2015-04-19 06:19:02
阅读次数:
155
#include
#include
#include
#define M 300000
#define inf 0x3f3f3f3f
using namespace std;
int maxx,minn;
long long sum;
int r,c,m;
struct T
{
int left,right,min,max,sum;
int add,set;
}tree[M];
s...
分类:
其他好文 时间:
2015-04-16 21:59:46
阅读次数:
152
Problem 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,5,4,-7)...
分类:
其他好文 时间:
2015-04-16 17:17:35
阅读次数:
124
Problem Description
Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1].
Now your job is to calculate...
分类:
其他好文 时间:
2015-04-14 19:49:36
阅读次数:
133
??
Max Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 164592 Accepted Submission(s): 38540
Problem Description
Given a sequenc...
分类:
其他好文 时间:
2015-04-13 09:42:19
阅读次数:
148
Max Sum Plus Plus
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 18861 Accepted Submission(s): 6205Problem DescriptionNow I think you have...
分类:
其他好文 时间:
2015-04-09 23:50:05
阅读次数:
240