Submission #331839

#TimeUsernameProblemLanguageResultExecution timeMemory
331839MladenPCONSUL (info1cup19_consul)C++17
100 / 100
86 ms384 KiB
#include <bits/stdc++.h> #include<grader.h> using namespace std; void solve(int n) { int k = 30; if(n<=50) k = 25; int best = 0; int ans = -1; mt19937 mt_rand(time(0)); for(int i = 0;i<k;i++) { int s = uniform_int_distribution<int>(1, n)(mt_rand); int w = kth(s); int c = cnt(w); if(c>best) { best = c; ans = w; } } if(best>n/3) say_answer(ans); else say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...