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 <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;
pair<ll, ll> MinMax(ll v1, ll v2) {
ll vv1, vv2;
MinMax(v1, v2, &vv1, &vv2);
return make_pair(vv1, vv2);
}
long long findGap(int T, int N)
{
ll ans = 0;
pair<ll, ll> cv = MinMax(0, 1000000000000000);
while (cv.second-cv.first>1) {
pair<ll, ll> nv = MinMax(cv.first + 1, cv.second - 1);
if (nv.first == -1) {
ans = max(ans, cv.second - cv.first);
cv = nv;
continue;
}
ans = max({ ans,nv.first - cv.first,cv.second - nv.second });
cv = nv;
}
for (;;);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |