Submission #256853

#TimeUsernameProblemLanguageResultExecution timeMemory
256853GoolakhGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
// FUCKED UP FUCKED UP FUCKED UP FUCKED UP FUCKED UP #include <bits/stdc++.h> #include "gap.h" using namespace std; #pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math") #define F first #define S second #define pb push_back #define SZ(x) (ll)(x.size()) #define all(x) x.begin(),x.end() #define MP make_pair typedef long long ll; typedef long double ld; typedef pair<ll,ll> pll; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll maxn=1e5+10, maxm=5e4+10, lg=21, mod=998244353, inf=1e18; const ll MN=0,MX=inf; ll ret=MN,a[maxn]; ll findGap(ll T,ll n){ if(T==1){ ll L=MN,R=MX,k=0; for(int i=n;i>0;i-=2){ MinMax(L,R,&a[k],&a[n-1-k]); L=a[k]+1, R=a[n-1-k]-1; k++; } for(int i=1;i<n;i++) ret=max(ret,a[i]-a[i-1]); } else{ ll lf,ri,gap; MinMax(MN,MX,&lf,&ri); gap=ret=(ri-lf+n-2)/(n- 1); ll pr=-1; for(ll i=lf;i<=ri;i+=gap+1){ ll t1,t2; MinMax(i,min(i+gap,ri),&t1,&t2); if(t1!=-1){ if(pr!=-1) ret=max(ret,t1-pr); pr=t2; } } } return ret; } /* int main(){ ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); return 0; } */

Compilation message (stderr)

/tmp/cch27urV.o: In function `main':
grader.cpp:(.text.startup+0x18e): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status