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 "grader.cpp"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
void solve(int n)
{
int x;
map<int,bool>mp;
int vis[1001]={0};
int cur=60;
bool ok=0;
while(cur--)
{
x=rand()%n+1;
if(vis[x]) continue;
vis[x]=1;
int y=kth(x);
if(!mp[y])
{
mp[y]=1;
if(cnt(y)>n/3)
{
ok=1;
say_answer(y);
break;
}
}
}
if(!ok) 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... |