Submission #142983

#TimeUsernameProblemLanguageResultExecution timeMemory
142983IC_COLDSTOPGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define int ll #define MP make_pair #define pb push_back #define F first #define S second #define REP(i,a,b) for(int i=a; i<b; i++) #define pii pair<int,int> #include "gap.h" const int MX=1e5+3; int n; int ANS1(){ int l=0, r=1e18, st=0, en=n-1, arr[MX]; while(st<=en){ ll a,b; MinMax(l,r,&a,&b); arr[st++]=a, arr[en--]=b; } int cnt=0; REP(i,0,n-1) cnt=max(cnt, arr[i+1]-arr[i]); return cnt; } int ANS2(){ ll a,b; MinMax(0,1e18,&a,&b); int cnt=(b-a+(n-2))/(n-1), ans=cnt, lst=a, tmp=0; while(lst<=b){ ll l,r; MinMax(lst+tmp+1,lst+tmp+cnt,&l,&r); if(l==-1) tmp+=cnt; else{ ans=max(ans, lst-l); lst=r; tmp=0; } } return ans; } ll findGap(int t,int n){ ::n=n; if(t==1) return ANS1(); return ANS2(); }

Compilation message (stderr)

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