제출 #1133479

#제출 시각아이디문제언어결과실행 시간메모리
1133479lopkusBigger segments (IZhO19_segments)C++20
0 / 100
0 ms324 KiB
#include <bits/stdc++.h>. #define int long long using namespace std; signed main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n + 1); for(int i = 1; i <= n; i++) { cin >> a[i]; } int prevsum = 0; int ans = 0; for(int i = 1; i <= n;) { int j = i + 1; int currentsum = a[i]; while(prevsum > currentsum) { currentsum += a[j++]; } ans += 1; i = j; prevsum = currentsum; } cout << ans; }

컴파일 시 표준 에러 (stderr) 메시지

segments.cpp:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>.
      |                         ^
#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...