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<bits/stdc++.h>
using namespace std;
void solve(int n)
{
/// insert your code
/// for example
set<int>checked;
srand(23543);
int cnt1=0;
for(;cnt1+2<=min(n,60);)
{
int i=rand()%n+1;
if(checked.find(i)!=checked.end())continue;
checked.insert(i);
cnt1+=2;
int val=kth(i);
if(cnt(val)*3>n)
{
say_answer(val);
return;
}
}
say_answer(-1);
return;
if(cnt(kth(1)) > n / 3) say_answer(kth(1));
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... |