# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145632 | dolphingarlic | Hacker (BOI15_hac) | C++14 | 89 ms | 22568 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Basically we want Bytesar to start on the computer with
// the maximum of the minimums of semicircle sums that contain
// that computer, since the operator is able to force him to do that
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1000050;
int a[N];
ll sum[N], p[N];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i], a[i + n] = a[i];
for (int i = 1; i <= n * 2; i++) sum[i] = sum[i - 1] + a[i]; // Prefix sums
int sz = (n + 1) / 2;
// Sums of semicircles
for (int i = 1; i <= n; i++) p[i] = sum[i + sz - 1] - sum[i - 1];
for (int i = n + 1; i <= n * 2; i++) p[i] = p[i - n];
// Monotonic queue - Easily get min in range
deque<int> dq;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |