Submission #31570

#TimeUsernameProblemLanguageResultExecution timeMemory
31570minkankHacker (BOI15_hac)C++14
0 / 100
89 ms5920 KiB
#include <bits/stdc++.h> using namespace std; const int N = 5e5 + 5; int s[N], a[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...