Submission #523155

#TimeUsernameProblemLanguageResultExecution timeMemory
523155reniCONSUL (info1cup19_consul)C++14
100 / 100
29 ms204 KiB
#include "grader.h" #include<unordered_map> #include <stdlib.h> #include<time.h> #include<iostream> using namespace std; void solve(int n) { unordered_map<long long, int>mp; srand (time(0)); int br=0; if(n<=50)br=10; for(int i=1;i<=60;i++) { if(br>58)break; long long pos=rand()%n+1; long long val=kth(pos);br++; if(mp.count(val))continue; mp[val]=1; br++; if(cnt(val) > n / 3){say_answer(val);return;} } say_answer(-1);return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...