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"
#define int long long
using namespace std;
//#define DEBUGGING
#ifdef DEBUGGING
#include "../debug.h"
#else
#define debug(x...) void(42)
#endif
int subtask1(int n)
{
vector<int> v(n);
int l, r;
MinMax(0, 1e18, &l, &r);
l++;
r--;
int res = 0;
while (r>l)
{
debug(l, r);
int a, b;
MinMax(l, r, &a, &b);
if (a == -1)
break;
debug(a, l, b, r);
res = max({res, a - l + 1, r - b + 1});
l = a+1;
r = b-1;
}
debug(l, r);
res = max(res, r-l+2);
return res;
}
int findGap(int32_t t, int32_t n)
{
return subtask1(n);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |