Submission #315226

#TimeUsernameProblemLanguageResultExecution timeMemory
315226yjojdkgk5bpCONSUL (info1cup19_consul)C++14
100 / 100
41 ms288 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; void solve(int n) { srand(time(0)); int v; if(n<=50) { map<int,int> can; for(int i=1; i<=n; i++) { v=kth(i); can[v]++; if(can[v]>n/3) { say_answer(v); return; } } say_answer(-1); } else { for(int i=1; i<=30; i++) { int k=(rand()%n)+1; v=kth(k); if(cnt(v)>n/3) { say_answer(v); return; } } say_answer(-1); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...