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;
long long findGap(int t, int n)
{
if(t == 1)
{
vector<long long> a, b;
long long st=0, dr=1e18;
while(st <= dr)
{
long long nSt, nDr;
MinMax(st, dr, &nSt, &nDr);
st=nSt;
dr=nDr;
if(st == -1)
break;
a.push_back(st);
if(st != dr)
b.push_back(dr);
st++;
dr--;
}
reverse(b.begin(), b.end());
a.insert(a.end(), b.begin(), b.end());
long long ans=0;
for(int i=1;i<(int)a.size();i++)
ans=max(ans, a[i]-a[i-1]);
return ans;
}
else
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |