Submission #632151

#TimeUsernameProblemLanguageResultExecution timeMemory
632151boris_mihovCONSUL (info1cup19_consul)C++17
85 / 100
29 ms288 KiB
#include "grader.h" #include <algorithm> #include <iostream> #include <numeric> #include <vector> typedef long long llong; const int MAXN = 1000 + 10; const int INF = 1e9; bool used[MAXN]; void solve(int n) { srand(69); std::fill(used + 1, used + 1 + n, false); for (int i = 1 ; i <= std::min(n, 30) ; ++i) { int curr; do { curr = rand()%n + 1; } while (used[curr]); used[curr] = true; curr = kth(curr); if (cnt(curr) > n/3) { say_answer(curr); return; } } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...