Submission #723546

#TimeUsernameProblemLanguageResultExecution timeMemory
723546yahyobekabdunazarovHacker (BOI15_hac)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int MAXN = 5e5 + 9; int a[MAXN], dp[MAXN]; bool used[MAXN]; signed main(){ int n; cin >> n; for(int i = 0; i < n; i++){ cin >> a[i]; dp[i + 1] = dp[i] + a[i]; } priority_queue<int> pq; for(int i = 0; i < n; i++){ pq.push(dp[min(i + n / 2 + n % 2, n)] - dp[i] + dp[max(i + n / 2 + n % 2 - n, 0ll)]); } pq.pop(); cout << pq.top(); 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...