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 in…
#include<iostream> #include<vector> using namespace std; typedef struct { int maxsum; int first; int end; }resultArryType; void OutResult(vector<int> vec, int num) { resultArryType resultArry; int max = 0; int numCount = 0; int maxsum =…
HDU1003 HDU1231 题意自明.可能是真的进步了点,记得刚开始研究这个问题时还想了好长时间,hdu 1231还手推了很长时间,今天重新写干净利落就AC了. #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; ; int a[MAXN]; int main() { int T,N; scanf("%d&q…