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 v[1000005],i,j;
long long findGap(int T, int N)
{
i=0;
long long c=0,d=1,c1=0,d1=1,o=0;
long long *a=&c,*b=&d;
while (i<N)
{
MinMax(c1,d1,a,b);
if (*a+*b==-2)
{
d1+=2;
d+=2;
*b=d;
continue;
}
c1=*a;
c1++;
d1=c+2;
v[i]=*a;
c=*a;
if (i)
{
o=max(o,v[i]-v[i-1]);
}
i++;
c++;
d=c+1;
*b=d;
}
return o;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |