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 <vector>
#include <iostream>
using namespace std;
using lli = long long;
lli findGap1(int N) {
vector<lli> seq(N);
lli L = 0, R = 1e18;
for (int i = 0, j = N - 1; i <= j; i++, j--) {
MinMax(L, R, &seq[i], &seq[j]);
L = seq[i] + 1, R = seq[j] - 1;
}
lli res = 0;
for (int i = 0; i + 1 < N; i++)
res = max(res, seq[i + 1] - seq[i]);
return res;
}
long long findGap2(int N) {
return -1;
}
long long findGap(int T, int N) {
return (T == 1) ? findGap1(N) : findGap2(N);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |