#include<bits/stdc++.h>
using namespace std;
#define VIS(it,con) for(auto it=con.begin();it!=con.end();++it)
#define MIN(x,y) (x=min(x,(y)))
#define MAX(x,y) (x=max(x,(y)))
#define REP(i,j,k) for(register int i=(j);i<(k);++i)
#define RREP(i,j,k) for(register int i=(j)-1;i>=(k);--i)
#define ALL(a) a.begin(),a.end()
#define MST(a,v) memset(a,(v),sizeof a)
#define pb push_back
typedef long long ll;
ll findGap(int t,int n){
ll mn,mx,res=0;
if(t==1){
vector<ll>num;
ll lb=0,rb=1e18;
REP(i,0,(n+1)/2){
MinMax(lb,rb,&mn,&mx);
num.pb(mn);
if(n%2==0||i<(n+1)/2)num.pb(mx);
lb=mn+1,rb=mx-1;
}
sort(ALL(num));
REP(i,1,n)MAX(res,num[i]-num[i-1]);
}else{
MinMax(0,1e18,&mn,&mx);
ll d=res=(mx-mn+n-2)/(n-1);
int lb=mn,last=mn;
while(1){
MinMax(lb,lb+d,&mn,&mx);
MAX(res,mn-last);
lb+=d+1;
last=mx;
}
}
return res;
}
Compilation message
gap.cpp: In function 'll findGap(int, int)':
gap.cpp:19:4: error: 'MinMax' was not declared in this scope
MinMax(lb,rb,&mn,&mx);
^~~~~~
gap.cpp:19:4: note: suggested alternative: 'rindex'
MinMax(lb,rb,&mn,&mx);
^~~~~~
rindex
gap.cpp:27:3: error: 'MinMax' was not declared in this scope
MinMax(0,1e18,&mn,&mx);
^~~~~~
gap.cpp:27:3: note: suggested alternative: 'rindex'
MinMax(0,1e18,&mn,&mx);
^~~~~~
rindex