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;
int kth(int x);
int cnt(int x);
void say_answer(int x);
mt19937 gen(22);
int n;
void solve(int N) {
n = N;
int limit = n <= 50 ? 50 : 60;
for (int i = 0; i < limit; i += 2) {
int pos = gen() % n + 1;
int x = kth(pos);
if (cnt(x) > n / 3) {
say_answer(x);
return;
}
}
say_answer(-1);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |