Submission #860598

# Submission time Handle Problem Language Result Execution time Memory
860598 2023-10-13T13:00:28 Z Darren0724 Hacker (BOI15_hac) C++17
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define all(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(false);cin.tie(0);
int32_t main(){
    fast;
    int n;cin>>n;
    vector<int> v(3*n+1),pre(3*n+1);
    for(int i=1;i<=n;i++){
        cin>>v[i];
        v[i+2*n]=v[i+n]=v[i];
    }
    for(int i=1;i<=3*n;i++){
        pre[i]=pre[i-1]+v[i];
    }
    int ans=0;
    int p=(n+1)/2;
    for(int i=1;i<=n;i++){
        ans=max(ans,min(pre[i+n]-pre[i+n-p],pre[i+n+p-1]-pre[i+n-1]));
    }
    cout<<ans<<endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -