[解題報告][ZeroJudge][d563] 等值首尾和 七月 9, 2010 程式碼, ZeroJudge 本文总阅读量次 1234567891011121314151617181920212223242526/*Problem: d563Language: C++Result: AC (18ms, 1106KB) on ZeroJudgeAuthor: m80126colin at 2010-07-09 18:50:53Solution: Straight Forward*/#include <iostream>using namespace std;int main() { int n,i,j,t,q,a[100000],ox[100000]; scanf("%d",&n); for (i=t=0;i<n;i++) { scanf("%d",&a[i]); t+=a[i]; ox[i]=t; } j=q=0; for (i=t=0;i<n&&j<n;i++) { t+=a[n-1-i]; while (t>ox[j]&&j<n) j++; if (t==ox[j]) q++; } cout<<q<<endl;} Newer [解題報告][ZeroJudge][d566] 秒殺率 Older [解題報告][ZeroJudge][d562] 山寨版磁力蜈蚣