# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401658 | BERNARB01 | Gap (APIO16_gap) | C++17 | 58 ms | 1984 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;
long long findGap(int T, int N) {
if (T == 1) {
long long lb = 0, rb = (long long) 1e18L;
int l = 0, r = N - 1;
vector<long long> a(N);
while (l <= r) {
MinMax(lb, rb, &a[l], &a[r]);
assert(a[l] != -1 && a[r] != -1);
lb = a[l++] + 1;
rb = a[r--] - 1;
}
long long ans = 0;
for (int i = 1; i < N; i++) {
ans = max(ans, a[i] - a[i - 1]);
}
return ans;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |