# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
125823 | dragoon | Gap (APIO16_gap) | C++14 | 83 ms | 5252 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.
#include "gap.h"
#include <vector>
#include <algorithm>
using namespace std;
typedef long long LL;
LL Solve1(int N) {
vector<LL> V(N, 0);
LL a = 0, b = 1000000000000000000LL;
a--, b++;
for (int i = 0, j = N - 1; i <= j; i++, j--) {
LL c, d;
MinMax(a, b, &c, &d);
V[i] = c;
V[j] = d;
a = c + 1;
b = d - 1;
}
LL ans = 0;
for (int i = 0; i < N - 1; i++) ans = max(ans, V[i + 1] - V[i]);
return ans;
}
LL Solve2(int N) {
vector<LL> V;
LL a = 0, b = 1000000000000000000LL;
a--, b++;
{
LL c, d;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |