Submission #336918

#TimeUsernameProblemLanguageResultExecution timeMemory
336918kutbilim_oneBigger segments (IZhO19_segments)C++14
0 / 100
1 ms364 KiB
/** @kutbilimone **/ #include <bits/stdc++.h> using namespace std; #define endl '\n' #define int long long signed main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> a(n); int res = 1; for(int i = 0, sum = 0, last; i < n; i++){ cin >> a[i]; if(!i){ last = a[i]; continue; } sum += a[i]; if(sum >= last) res++, last = sum, sum = 0; } cout << res; 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...