# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
708570 | hngwlog | Gap (APIO16_gap) | C++14 | 42 ms | 1948 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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
long long findGap(int t, int n) {
vector<long long> a(n + 1);
if (t == 1) {
long long mi = - 1, ma = 1e18 + 1;
int l = 1;
int r = n;
while (l <= r) {
MinMax(mi + 1, ma - 1, &mi, &ma);
a[l] = mi, a[r] = ma;
l++, r--;
}
long long ans = 0;
for (int i = 2; 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... |