Submission #469012

#TimeUsernameProblemLanguageResultExecution timeMemory
469012Cross_RatioThe Big Prize (IOI17_prize)C++14
Compilation error
0 ms0 KiB
#include "prize.h" #include <bits/stdc++.h> using namespace std; int find_best(int N) { int s = 0; int e = N; srand(0); int cnt = 0; mt19937 engine((unsigned int)time(nullptr)); uniform_int<int> distribution(0, 200005); auto generator = bind(distribution, engine); while(s + 1 != e) { int mid = generator() % (e - s) + s; vector<int> V = ask(mid); if(V[0] == 0 && V[1] == 0) return mid; else if(V[0] == 0) s = mid; else if(V[1] == 0) e = mid; cnt++; assert(cnt < 10000); } }

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:13:5: error: 'uniform_int' was not declared in this scope
   13 |     uniform_int<int> distribution(0, 200005);
      |     ^~~~~~~~~~~
prize.cpp:13:17: error: expected primary-expression before 'int'
   13 |     uniform_int<int> distribution(0, 200005);
      |                 ^~~
prize.cpp:14:27: error: 'distribution' was not declared in this scope
   14 |     auto generator = bind(distribution, engine);
      |                           ^~~~~~~~~~~~
prize.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^