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>
#ifdef atom
#include "grader.cpp"
#else
#include "gap.h"
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vvi vector< vi >
#define vii vector< ii >
#define mp make_pair
#define pb push_back
long long findGap(int T, int n)
{
ll left, right;
MinMax(0, 1e18, &left, &right);
ll best = 0;
if(T == 1)
{
ll lmin = left, lmax = right;
for(int i = 0; i< n; i+= 2)
{
ll mmin, mmax;
if(lmin+1> lmax-1) break;
MinMax(lmin+1, lmax-1, &mmin, &mmax);
if(mmin == -1) break;
best = max(best, lmax-mmax);
best = max(best, mmin-lmin);
lmin = mmin; lmax = mmax;
}
best = max(best, lmax-lmin);
}
return best;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |