Submission #441702

#TimeUsernameProblemLanguageResultExecution timeMemory
441702julian33Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) { cerr<<vars<<" = "; string delim=""; (...,(cerr<<delim<<values,delim=", ")); cerr<<"\n"; } #else #define deb(...) logger(#__VA_ARGS__, __VA_ARGS__) template<typename ...Args> void logger(string vars, Args&&... values) {} #endif #define FOR(i,j,n) for(int i=j;i<n;i++) #define pb push_back #define sz(x) (int)(x.size()) typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; template<typename T> inline void maxa(T& a,T b){a=max(a,b);} template<typename T> inline void mina(T& a,T b){a=min(a,b);} vector<ll> A; void MinMax(ll s,ll t,ll &mn, ll &mx){ // mn=*lower_bound(A.begin(),A.end(),s); // mx=*--lower_bound(A.begin(),A.end(),t+1); } ll findGap(int t, ll n){ assert(t==1); ll mn=0; ll mx=1e18; vector<ll> ans; for(int i=0;i<=n/2 && mn!=mx;i++){ MinMax(mn,mx,mn,mx); ans.pb(mn); ans.pb(mx); mn++; mx++; } while(sz(ans)<n) ans.pb(mn); sort(ans.begin(),ans.end()); ll best=0; for(int i=1;i<n;i++){ maxa(best,ans[i]-ans[i-1]); } return best; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccDlfZjZ.o: in function `main':
grader.cpp:(.text.startup+0x1b7): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status