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){
long long mn,mx,s,t;
s=0;
t=1e18;
mn=1;
mx=2;
long long maxi=0;
MinMax(s,t,&mn,&mx);
long long x=mn,y=mx;
long long i=0;
while(mn!=mx){
if(i==1){
maxi=max(maxi,mn-x);
maxi=max(maxi,mx-y);
x=mn;
y=mx;
}
else
i=1;
MinMax(mn+1,mx-1,&mn,&mx);
}
if(mn==-1){
maxi=max(maxi,y-x);
}
else{
maxi=max(maxi,mx-x);
maxi=max(maxi,y-mx);
}
return maxi;
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
36 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |