# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108323 | polyfish | Gap (APIO16_gap) | C++14 | 53 ms | 1152 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 <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
long long subtask1(int N) {
long long l = -INF, r = INF;
long long res = 0;
while (l<r) {
long long mn, mx;
MinMax(l+1, r-1, &mn, &mx);
if (mx==-1)
break;
if (l!=-INF)
res = max(res, max(mn-l, r-mx));
l = mn;
r = mx;
}
res = max(res, r-l);
return res;
}
long long findGap(int T, int N) {
if (T==1)
return subtask1(N);
// else
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |