Submission #427406

#TimeUsernameProblemLanguageResultExecution timeMemory
427406MilosMilutinovicCONSUL (info1cup19_consul)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; mt19937 rng(time(0)); void solve(int N) { for (int rep = 1; rep <= 25; rep++) { int pos = rng() % N + 1; int element = kth(pos); if (cnt(element) > N / 3) return element; } say_answer(-1); }

Compilation message (stderr)

consul.cpp: In function 'void solve(int)':
consul.cpp:13:42: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |         if (cnt(element) > N / 3) return element;
      |                                          ^~~~~~~