杭电ACM1003题目意思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 i
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/06 16:09:25
![杭电ACM1003题目意思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 i](/uploads/image/z/7152681-57-1.jpg?t=%E6%9D%AD%E7%94%B5ACM1003%E9%A2%98%E7%9B%AE%E6%84%8F%E6%80%9DProblem+DescriptionGiven+a+sequence+a%5B1%5D%2Ca%5B2%5D%2Ca%5B3%5D.a%5Bn%5D%2Cyour+job+is+to+calculate+the+max+sum+of+a+sub-sequence.For+example%2Cgiven+%286%2C-1%2C5%2C4%2C-7%29%2Cthe+max+sum+in+this+sequence+is+6+%2B+%28-1%29+%2B+5+%2B+4+%3D+14.InputThe+first+line+of+the+i)
杭电ACM1003题目意思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 i
杭电ACM1003题目意思
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 + 4 = 14.
Input
The first line of the input contains an integer T(1
杭电ACM1003题目意思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 i
应该说是最大和的子序列,就是一个序列取它连续的一段数,要求和最大.
你没有理解case1输入数据的意思啊~
5 6 -1 5 4 -7
第一个5是表示这个test的序列长度,于是后面就输入了6 -1 5 4 -7这5个数字~
于是最大和是14,从6到4没有错.
最大和子序列用动规求解.很经典的动规