本文共 1485 字,大约阅读时间需要 4 分钟。
25 6 -1 5 4 -77 0 6 -1 1 -6 7 -5
Case 1:14 1 4Case 2:7 1 6
#include#include #include using namespace std;int main(){ long long n,m,i,k,begin,bbegin,end,eend,max,sum,t; cin>>k; n=1; while(k--) { cin>>m; for(i=1;i<=m;i++) { cin>>t; if(i==1) { sum=max=t; bbegin=begin=eend=end=1; } else { if(sum+t max) { max=sum; bbegin=begin; eend=i; } } cout<<"Case "< <<":"<
转载地址:http://kxfci.baihongyu.com/