Submission #170461

#TimeUsernameProblemLanguageResultExecution timeMemory
170461MounirCONSUL (info1cup19_consul)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void solve(int N){ srand(42); int tot = 0; set<int> faits; while (tot <= 2*N/3){ int cur = kth((int)rand()%N); if (faits.count(cur) == 0){ // cout << cur << endl; int nCur = cnt(cur); if (nCur >= double(N)/3){ say_answer(cur); return; } tot += nCur; faits.insert(cur); } } 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
   int cur = kth((int)rand()%N);
             ^~~
consul.cpp:14:15: error: 'cnt' was not declared in this scope
    int nCur = cnt(cur);
               ^~~
consul.cpp:14:15: note: suggested alternative: 'int'
    int nCur = cnt(cur);
               ^~~
               int
consul.cpp:16:5: error: 'say_answer' was not declared in this scope
     say_answer(cur);
     ^~~~~~~~~~
consul.cpp:16:5: note: suggested alternative: 'sa_handler'
     say_answer(cur);
     ^~~~~~~~~~
     sa_handler
consul.cpp:23:2: error: 'say_answer' was not declared in this scope
  say_answer(-1);
  ^~~~~~~~~~
consul.cpp:23:2: note: suggested alternative: 'sa_handler'
  say_answer(-1);
  ^~~~~~~~~~
  sa_handler