제출 #31571

#제출 시각아이디문제언어결과실행 시간메모리
31571minkankHacker (BOI15_hac)C++14
20 / 100
156 ms9828 KiB
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 5; int s[2 * N], a[2 * N], n; int main() { cin >> n; for(int i = 1; i <= n; ++i) cin >> a[i], a[i + n] = a[i]; for(int i = 1; i <= 2 * n; ++i) s[i] = s[i - 1] + a[i]; int len = (n + 1) / 2, ans = 2e9; for(int i = n + 1 - len + 1; i <= n + 1; ++i) ans = min(ans, s[i + len - 1] - s[i - 1]); 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...