제출 #426149

#제출 시각아이디문제언어결과실행 시간메모리
426149penguinhackerHacker (BOI15_hac)C++14
0 / 100
1 ms332 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array const int mxN=5e5; int n, a[mxN], cur, s[mxN]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for (int i=0; i<n; ++i) cin >> a[i]; int m=(n+1)/2; for (int i=0; i<m; ++i) cur+=a[i]; s[0]=cur; for (int i=1; i<m; ++i) { cur+=a[(i+m-1)%n]-a[i-1]; s[i]=cur; } int ans=0; for (int i=0; i<n; ++i) ans=max(ans, min(s[i], s[(i+m-1)%n])); 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...