Submission #524277

#TimeUsernameProblemLanguageResultExecution timeMemory
524277maks007CONSUL (info1cup19_consul)C++14
100 / 100
42 ms292 KiB
#include <bits/stdc++.h> #include <map> #include "grader.h" using namespace std; void solve(int n) { srand(time(0)); map <int,int> mp; vector <int> used(n); set <int> s; if(n <= 50) { for(int i = 0; i < n; i ++) { int val = kth(i+1); mp[val] ++; if(mp[val] > n / 3) { say_answer(val); return; } } say_answer(-1); return; } for(int i = 0; i < 30; i ++) { int val = rand() % n; int k = kth(val+1); if(cnt(k) > n/3) { say_answer(k); return; } mp[k] ++; } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...