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 = 30;
if(n<=50)
k = 25;
int best = 0;
int ans = -1;
mt19937 mt_rand(time(0));
for(int i = 0;i<k;i++)
{
int s = uniform_int_distribution<int>(1, n)(mt_rand);
int w = kth(s);
int c = cnt(w);
if(c>best)
{
best = c;
ans = w;
}
}
if(best>n/3)
say_answer(ans);
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... |