# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498943 | cadmiumsky | CONSUL (info1cup19_consul) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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);
}