Submission #887499

# Submission time Handle Problem Language Result Execution time Memory
887499 2023-12-14T16:24:22 Z TK_LD0102 Hacker (BOI15_hac) C++17
0 / 100
0 ms 348 KB
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
int main(){
	ll n; cin >> n;
	vector<ll> a(2 * n + 1);
	a[0] = 0;
	multiset<ll> d;
	ll S = (n + 1) / 2;
	for (ll i = 1; i <= n; i++){
		cin >> a[i]; a[n + i] = a[i];
	}
	for (ll i = 1; i <= 2 * n; i++) a[i] += a[i - 1];
	ll res = 0;
	vector<ll> c(n + 1, 0);
	for (ll i = 1; i <= 2 * n; i++){
		if (i + S - 1 <= 2 * n) d.insert(a[i + S - 1] - a[i - 1]);
		if (i > S) d.erase(d.find(a[i - 1] - a[i - 1 - S]));
		ll tempt = ((i - 1) % n) + 1;
		c[tempt] = min(c[tempt], *c.begin());
	}
	for (ll i = 1; i <= n; i++) res=max(res, c[i]);
	cout << res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -