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;
int a,b,c,d,e,i,j,ii,jj,zx,xc,Q,t,tes,f[200009],bo[200009];
/*int kth(int k);
void say_answer(int k);
int cnt(int k);*/
int nicerand(int q){
int w=0,we=1;
while(q>0){
q--;
if(rand()%2!=0) w+=we;
we*=2;
}
return w;
}
void solve(int n)
{
/// insert your code
/// for example
/*if(cnt(kth(1)) > n / 3) say_answer(kth(1));
else say_answer(-1);*/
a=n;
if(n<=50) Q=50; else Q=60;
e=0;
while(e<=Q){
c=nicerand(20)%a+1;
e+=2;
zx=kth(c);
xc=cnt(zx);
if(xc>a/3){
say_answer(zx);
break;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |