This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/** @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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |