找错

P1181 数列分段 Section I

样例过了,全wa
by 初嫁QAQ @ 2018-09-22 20:06:57


自我感觉良好。。。。。~~~~
by 初嫁QAQ @ 2018-09-22 20:12:40


~~自我感觉so good~~
by 初嫁QAQ @ 2018-09-22 20:13:21


@[初嫁QAQ](/space/show?uid=102028) //int n,z,ans=1,he=0;; 你确定?
by LinAPro @ 2018-10-10 17:51:04


for(int i=n;i>=1;i--) { he+=a[i];//已经加了一遍 if(he<=z) { he+=a[i];//这里又加一遍 continue; } else { he=0; ans++; //cout<<i<<endl; } } cout<<ans<<endl; return 0; }
by LinAPro @ 2018-10-10 17:52:04


|