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 <algorithm>
using namespace std;
long long findGap(int T, int N){
long long int m, n;
MinMax(1, 1000000000000000000LL, &m, &n);
long long int ans = 0;
long long int a, b;
for (int i = 0; i < (N - 1) / 2; i++) {
a = m, b = n;
MinMax(a + 1, b - 1, &m, &n);
ans = max(ans, max(m - a, b - n));
}
ans = max(ans, n - m);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |