Submission #283845

#TimeUsernameProblemLanguageResultExecution timeMemory
283845balbitThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define f first #define s second #define ALL(x) (x).begin(), (x).end() #define SZ(x) (int)((x).size()) #define pb push_back #ifdef BALBIT #define bug(...) cerr<<"#"<<__LINE__<<" "<<#__VA_ARGS__<<": ", _do(__VA_ARGS__) template <typename T> void _do(T && x) {cerr<<x<<endl;} template <typename T, typename ...S> void _do(T && x, S&&...y) {cerr<<x<<", "; _do(y...);} #define IOS() #else #define bug(...) #define IOS() ios::sync_with_stdio(0), cin.tie(0) #define endl '\n' #endif int find_best(int n) { int l = 0, r = n-1; while (l!=r) { int mid = (l+r)/2; vector<int> x = ask(mid); if (x[0] == 0 && x[1] == 0) return mid; if (x[1]) l = mid+1; else r = mid-1; } return l; } #ifdef BALBIT signed main(){ IOS(); bug(1,2); } #endif

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:29:19: error: 'ask' was not declared in this scope
   29 |   vector<int> x = ask(mid);
      |                   ^~~