제출 #723555

#제출 시각아이디문제언어결과실행 시간메모리
723555Mr_HusanboyHacker (BOI15_hac)C++17
0 / 100
2 ms212 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; void solve(){ int n; cin >> n; vector<int> v(n); for(int i = 0; i < n; i ++) cin >> v[i]; ll ans = 0; int k = (n + 1) / 2; for(int i = 0; i < n; i ++){ ll a = 0, b = 0; for(int j = 0; j < k; j ++){ a += v[(i + j) % n]; b += v[((i - j) % n + n) % n]; } ans = max(ans, min(a,b)); } cout << ans; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int testcases = 1; while(testcases --){ solve(); if(testcases) cout << '\n'; #ifdef LOCAL else cout << '\n'; cout << "__________________________" << endl; #endif } 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...