Submission #81648

#TimeUsernameProblemLanguageResultExecution timeMemory
81648xiaowuc1Gap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll MinMax(ll s, ll t, ll& mn, ll& mx); ll onesolve(int n) { return 0; } ll twosolve(int n) { ll lhs, rhs; MinMax(1, 1000000000000000000LL, lhs, rhs); ll ret = (rhs-lhs+n-2)/(n-1); set<ll> all; all.insert(lhs); all.insert(rhs); ll last = lhs+1; while(last <= rhs) { MinMax(last, last + ret, lhs, rhs); if(lhs >= 0) { all.insert(lhs); all.insert(rhs); } } ll lowest = *all.begin(); for(ll out: all) { ret = max(ret, out - lowest); lowest = out; } return ret; } ll findGap(int t, int n) { if(t==1) return onesolve(n); else return twosolve(n); }

Compilation message (stderr)

/tmp/ccsAt9Q8.o: In function `twosolve(int)':
gap.cpp:(.text+0x42): undefined reference to `MinMax(long long, long long, long long&, long long&)'
gap.cpp:(.text+0xcf): undefined reference to `MinMax(long long, long long, long long&, long long&)'
collect2: error: ld returned 1 exit status