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;
typedef long long ll;
using namespace std;
const ll INF = 1e18;
int t, n;
ll solve_1(){
ll l, r, ans = 0;
MinMax(0, INF, &l, &r);
ll l2, r2;
n -= 2;
while(n >= 0){
MinMax(l + 1, r - 1, &l2, &r2);
ans = max(ans, max(l2 - l, r - r2));
l = l2, r = r2;
}
ans = max(ans, r - l);
return ans;
}
ll findGap(int _t, int _n){
t = _t, n = _n;
return solve_1();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |