제출 #910957

#제출 시각아이디문제언어결과실행 시간메모리
910957daoquanglinh2007Bigger segments (IZhO19_segments)C++17
0 / 100
1 ms2396 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair <int, int> #define fi first #define se second #define mp make_pair const int NM = 5e5; int N, a[NM+5], pref[NM+5], ans = 0; pii dp[NM+5]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N; for (int i = 1; i <= N; i++) cin >> a[i]; int cur = 0, pre = 1; for (int i = 1; i <= N; i++){ cur += a[i]; if (cur >= pre){ ans++; pre = cur; cur = 0; } } cout << ans; 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...