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>
#include "grader.h"
using namespace std;
void solve(int n)
{
int k;
if(n > 50) k = 30;
else k = 25;
int m = 0, a = -1;
mt19937 mt_rand(time(0));
while(k--)
{
int i = uniform_int_distribution <int> (1, n)(mt_rand);
int e = kth(i), c = cnt(e);
if(c > m)
{
m = c;
a = e;
}
}
if(m > n / 3) say_answer(a);
else 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... |