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<unordered_map>
#include <stdlib.h>
#include<time.h>
#include<iostream>
using namespace std;
void solve(int n)
{
unordered_map<long long, int>mp;
srand (time(0));
int br=0;
for(int i=1;i<=60;i++)
{
if(br>58)break;
long long pos=rand()%n+1;
long long val=kth(pos);br++;
if(mp.count(val))continue;
mp[val]=1;
br++;
if(cnt(val) > n / 3){say_answer(val);return;}
}
say_answer(-1);return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |