Submission #428685

#TimeUsernameProblemLanguageResultExecution timeMemory
428685Dremix10The Big Prize (IOI17_prize)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll,ll> pl; #define endl '\n' #define F first #define S second #define all(x) (x).begin(),(x).end() const int N = 3e5+1; const ll INF = 2e18; const int MOD = 1e9+7; //vector<int> ask(int i); int find_best(int n) { int l = 0,r = n-1; int ans = -1; while(l<=r){ int mid = (l+r)/2; vector<int> arr = ask(mid); assert(arr[0]+arr[1] <= 1); if(arr[0] == 1) r = mid-1; else if(arr[1] == 1) l = mid+1; else{ ans = mid; break; } } return ans; }

Compilation message (stderr)

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