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<iostream>
#include "gap.h"
#define int long long
using namespace std;
long long a[200000];
/*void MinMax(long long x,long long y,int *l,int *r)
{
cout<<x<<" "<<y<<"\n";
cin>>*l>>*r;
}*/
long long findGap(int32_t t,int32_t n)
{
if(t==1)
{
int l,r;
MinMax(0,(long long)1e18,&l,&r);
a[1]=l;
a[n]=r;
int pocz=2,kon=n-1;
while(pocz<=kon)
{
MinMax(a[pocz-1]+1,a[kon+1]-1,&l,&r);
a[pocz]=l;
a[kon]=r;
pocz++;
kon--;
}
long long wynik=0;
for(int i=1;i<n;i++)
wynik=max(wynik,a[i+1]-a[i]);
return wynik;
}
else{
}
}
Compilation message (stderr)
gap.cpp: In function 'long long int findGap(int32_t, int32_t)':
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... |