Submission #882738

#TimeUsernameProblemLanguageResultExecution timeMemory
882738kokoueBigger segments (IZhO19_segments)C++14
0 / 100
1 ms348 KiB
#include<bits/stdc++.h> using namespace std; int n; int a[1000000]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin>>n; for(int i=0;i<n;i++) { cin>>a[i]; } unsigned long long curr=0,prev=a[0]; int br=1; for(int i=1;i<n;i++) { curr+=a[i]; if(curr>=prev) { prev=curr; curr=0; br++; } } printf("%d\n",br); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...