# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
723571 |
2023-04-14T05:30:39 Z |
MDSPro |
Hacker (BOI15_hac) |
C++17 |
|
3 ms |
340 KB |
#include "bits/stdc++.h"
using namespace std;
int main(){
int n; cin >> n;
vector<int> v(2*n);
for(int i = 0; i < n; ++i){
int x; cin >> x;
v[i] = v[i+n] = x;
}
vector<int> ans(n,1e9);
int sum = 0;
int need = (n+1)/2;
for(int i = 0; i < 2*n; ++i){
if(i < need-1) sum += v[i];
else {
// i-need+1...i
sum += v[i];
cerr << i << ' ' << sum << '\n';
for(int j = i-need+1; j <= i; ++j) {
if(j > n) ans[j-n] = min(ans[j-n],sum);
else ans[j] = min(ans[j],sum);
}
sum -= v[i-need+1];
}
}
int res = 0;
for(int i = 0; i < n; ++i){
res = max(res,ans[i]);
}
cout << res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
3 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |