#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
bool used[12312];
void solve(int n)
{
std::random_device rd;
std::mt19937 gen(rd());
memset(used,0,sizeof(used));
int br=0;
while(1)
{
if(br==n)break;
std::uniform_int_distribution<> d(1, n);
int ans=d(gen);
if(used[ans])continue;
else
{
used[ans]=1;
br++;
}
ans=kth(ans);
if(cnt(ans)>n/3)
{
say_answer(ans);
break;
}
}
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... |