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>
typedef long long ll;
ll Min, Max, s, t;
ll findGap(int T, int N) {
if (T == 1) {
s = 0, t = 1e18;
ll arr[N];
int l = 0, r = N - 1;
while (l <= r) {
MinMax(s, t, &Min, &Max);
arr[l] = Min, arr[r] = Max;
s = Min + 1, t = Max - 1;
l++, --r;
}
ll ans = 0;
for (int i = 1; i < N; ++i) {
ans = std::max(ans, arr[i] - arr[i - 1]);
}
return ans;
} else {
return 0;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |