# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170461 | Mounir | 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 <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);
}