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 Solve1(long long N) {
long long A[N];
long long L = 0, R = N - 1;
long long valL = 0, valR = 1e18;
while(L <= R) {
MinMax(valL, valR, &valL, &valR);
A[L++] = valL;
A[R--] = valR;
valL++;
valR--;
}
long long ans = 0;
for(long long i = 1; i < N; i++) {
ans = max(ans, A[i] - A[i - 1]);
}
return ans;
}
long long findGap(int T, int N)
{
return Solve1(N);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |