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"
#define ll long long
#include<bits/stdc++.h>
using namespace std;
long long findGap(int T, int N) {
ll mn, mx, curmn, curmx;
MinMax((ll)1, (ll)1e18, &mn, &mx);
ll ans = 0;
while(N>2) {
MinMax(mn+1, mx-1, &curmn, &curmx);
ans = max(ans, max(curmn-mn, mx-curmx));
N -= 2;
mx = curmx;
mn = curmn;
}
ans = max(ans, mx-mn);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |