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 n=N;
map<int,int>mpp;
int cntt=min(N/2,(int)30);
while(cntt>=0){
int x=rand()%n;
if(mpp[x])continue;
int y=kth(x+1);
int yy=cnt(y);
if(yy>n/3){
say_answer(y);
return ;
}
mpp[x]=1;
cntt--;
}
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... |