Submission #364126

#TimeUsernameProblemLanguageResultExecution timeMemory
364126ahmedfouadnewCONSUL (info1cup19_consul)C++17
32.96 / 100
43 ms512 KiB
#include "grader.h" //#include "grader.cpp" #include<bits/stdc++.h> using namespace std; #define pb push_back void solve(int n) { int x; map<int,bool>mp; int vis[1001]={0}; int cur=60; bool ok=0; while(cur--) { x=rand()%n+1; if(vis[x]) continue; vis[x]=1; int y=kth(x); if(!mp[y]) { mp[y]=1; if(cnt(y)>n/3) { ok=1; say_answer(y); break; } } } if(!ok) say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...