Submission #409644

#TimeUsernameProblemLanguageResultExecution timeMemory
409644Atill83CONSUL (info1cup19_consul)C++14
85 / 100
37 ms456 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; int num[60005]; unordered_map<int, int> mp; void solve(int n) { memset(num, -1, sizeof(num)); mt19937 rng(time(NULL)); int q = 60; while(q >= 2){ int idx = rng() % n + 1; if(num[idx] == -1){ q--; num[idx] = kth(idx); } auto u = mp.find(num[idx]); int cn; if(u == mp.end()){ cn = cnt(num[idx]); q--; }else{ cn = (*u).second; } if(cn > n / 3){ say_answer(num[idx]); return; } } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...