Submission #713540

#TimeUsernameProblemLanguageResultExecution timeMemory
713540willychanBigger segments (IZhO19_segments)C++14
0 / 100
0 ms212 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; //#include<bits/extc++.h> //__gnu_pbds int main(){ ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n;cin>>n; ll prev = 0; ll sum = 0; ll cnt = 0; for(int i=0;i<n;i++){ int a;cin>>a; sum+=a; if(sum>=prev){ prev = sum; cnt++; sum=0; } } cout<<cnt<<"\n"; return 0; }
#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...