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 "grader.h"
#include <random>
#include <iostream>
using namespace std;
void solve(int n)
{
int mb = (n > 50 ? 30 : 25);
mt19937 rng(n^mb);
uniform_int_distribution<int> uni(0, 1e9);
for (int i = 0; i < mb; i++)
{
int ind = uni(rng) % n;
int cand = kth(ind + 1);
int app = cnt(cand);
if (app > n / 3)
{
say_answer(cand);
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... |