Submission #256612

# Submission time Handle Problem Language Result Execution time Memory
256612 2020-08-03T01:30:26 Z super_j6 Hacker (BOI15_hac) C++14
0 / 100
1 ms 384 KB
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

const int mxn = 1000001;
int n;
ll a[mxn];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		a[n + i] = a[i];
		a[i] += a[i - 1];
	}
	
	ll ret = 0;
	for(int i = n + 1; i <= 2 * n; i++){
		a[i] += a[i - 1];
		ret = max(ret, min(a[i] - a[i - (n + 1) / 2], 
			a[n] - (a[i - 1] - a[i - n / 2 - 1])));
	}
	
	cout << ret << endl;

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