摘要:
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), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputThe first line of the input contains an integer T(1<=T<=20) which means the number 阅读全文
posted @ 2014-03-29 23:41
蓝色记忆2013
阅读(106)
评论(0)
推荐(0)
摘要:
Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 using namespace std;int a[10000];int main(){ int k,j; int i; int p,q,p1; int sum,ans; while(cin>>k) { if(k==0) break; sum=0; j=0; p1=0; for(i=0;i>a[i]; if(... 阅读全文
posted @ 2014-03-29 23:38
蓝色记忆2013
阅读(163)
评论(0)
推荐(0)
摘要:
Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to work in the lucrative business of bank robbery only for a short while, before retiring to a comfortabl 阅读全文
posted @ 2014-03-29 23:26
蓝色记忆2013
阅读(586)
评论(0)
推荐(0)

浙公网安备 33010602011771号