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 <bits/stdc++.h>
#include "gap.h"
using namespace std;
typedef long long ll;
const ll inf = 1e18;
ll findGap(int T, int N){
ll lo, hi, t_lo, t_hi, ans = 0;
MinMax(0, inf, &lo, &hi);
while(lo < hi){
t_lo = lo, t_hi = hi;
MinMax(lo + 1, hi - 1, &lo, &hi);
if(lo == - 1){
ans = max(ans, t_hi - t_lo);
break;
}
ans = max(ans, t_hi - hi);
ans = max(ans, lo - t_hi);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |