This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Why am I so stupid? :c
#include <bits/stdc++.h>
#include "gap.h"
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
typedef long long ll;
using namespace std;
long long findGap(int t, int n) {
ll arr[n + 5];
arr[0] = 0, arr[n + 1] = (ll)1e18 + 1;
int l = 1, r = n;
while (l <= r) {
MinMax(arr[l - 1] + 1, arr[r + 1] - 1, arr + l, arr + r);
++l, --r;
}
ll ret = 0;
for (int i = 1; i < n; ++i) {
ret = max(ret, arr[i + 1] - arr[i]);
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |