Submission #498943

#TimeUsernameProblemLanguageResultExecution timeMemory
498943cadmiumskyCONSUL (info1cup19_consul)C++14
Compilation error
0 ms0 KiB
#include <random> #include <chrono> using namespace std; mt19937 rng(time(0)); void solve(int N) { for(int i=0; i<30; i++) { int index=(rng()%N)+1; int val=kth(index); int freq=cnt(val); if(freq > N/3) { say_answer(val); return; } } say_answer(-1); }

Compilation message (stderr)

consul.cpp: In function 'void solve(int)':
consul.cpp:11:13: error: 'kth' was not declared in this scope
   11 |     int val=kth(index);
      |             ^~~
consul.cpp:12:14: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |     int freq=cnt(val);
      |              ^~~
      |              int
consul.cpp:14:7: error: 'say_answer' was not declared in this scope
   14 |       say_answer(val);
      |       ^~~~~~~~~~
consul.cpp:18:3: error: 'say_answer' was not declared in this scope
   18 |   say_answer(-1);
      |   ^~~~~~~~~~