#include <bits/stdc++.h>
#include "gap.h"
#include "grader.cpp"
using namespace std;
const long long M = (1e6 + 5);
long long ans;
long long a[M];
long long l,r = 1e18;
long long ll,rr;
long long findGap(int T, int N)
{
if (T == 1 ) {
long long o = (N + 1) / 2;
ll = 1,rr = N;
while (o --) {
MinMax(l,r,&a[ll],&a[rr]);
l = a[ll] + 1,r = a[rr] - 1;
ll ++,rr --;
}
for (long long i = 1; i < N; i ++)
ans = max(ans,a[i + 1] - a[i]);
return ans;
}
else {
long long l = 0,r = 0;
MinMax(0,1e18,&l,&r);
long long last = l;
long long sz = (r - l - 1 + N - 2) / N;
long long s = l + 1,e = 0;
for (long long i = 1; i < N; i ++) {
e = s + sz - 1;
if (s > e)
break;
MinMax(s,e,&l,&r);
if (l != -1) {
ans = max(ans,s - last);
last = e;
}
s = e + 1;
}
return max(ans,(s - last));
}
}
Compilation message
/tmp/ccs9PTm5.o: In function `MinMax(long long, long long, long long*, long long*)':
grader.cpp:(.text+0x0): multiple definition of `MinMax(long long, long long, long long*, long long*)'
/tmp/cc4STVgs.o:gap.cpp:(.text+0x190): first defined here
/tmp/ccs9PTm5.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc4STVgs.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status