Submission #635778

#TimeUsernameProblemLanguageResultExecution timeMemory
635778Dec0DeddCONSUL (info1cup19_consul)C++14
85 / 100
63 ms336 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int rnd(int a, int b){ return a+rng()%(b-a+1); } void solve(int n) { pair<int, int> x={0, -1}; for (int i=0; i<30; ++i) { int r=rnd(1, n), val=kth(r); x=max(x, {cnt(val), val}); } if (x.first > n/3) say_answer(x.second); else say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...