Submission #960010

#TimeUsernameProblemLanguageResultExecution timeMemory
960010BlagojBigger segments (IZhO19_segments)C++17
0 / 100
0 ms500 KiB
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define all(x) (x).begin(), (x).end() int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int ans = 1, lastSum = a[0], sum = 0; for (int i = 1; i < n; i++) { sum += a[i]; if (sum >= lastSum) { ans++; sum = 0; } } cout << ans; }
#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...