Submission #363343

#TimeUsernameProblemLanguageResultExecution timeMemory
363343mosiashvililukaCONSUL (info1cup19_consul)C++14
100 / 100
33 ms384 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...