Submission #723561

# Submission time Handle Problem Language Result Execution time Memory
723561 2023-04-14T05:08:43 Z Erkinoff_Mohammed Hacker (BOI15_hac) C++14
0 / 100
1000 ms 852 KB
#include "bits/stdc++.h"
using namespace std;
#define INF 2000000000
#define INFLL 3000000000000000000LL
#define ll long long





int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n;
    cin>>n;
    ll arr[n];
    ll sum=0;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        sum+=arr[i];
    }
    ll mx=0;
    for(int i=0;i<n;i++){
        ll sum2=0;
        ll mn=INF;
        for(int j=i+1;j<i+n/2+1;j++){
            sum2+=arr[j%n];
        }
        for(int j=i+1;j<i+n/2+1;j++){
            //cout<<sum2<<"\n";
            mn=min(mn,sum-sum2);
            sum2-=arr[(j)%n];
            sum2+=arr[(j+n/2)%n];
        }
        //cout<<"\n";
        mx=max(mx,mn);
    }
    cout<<mx;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 212 KB Output is correct
3 Correct 172 ms 340 KB Output is correct
4 Execution timed out 1082 ms 852 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -