Submission #779870

#TimeUsernameProblemLanguageResultExecution timeMemory
779870rxlfd314CONSUL (info1cup19_consul)C++17
85 / 100
30 ms336 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; void solve(int N) { srand(time(NULL)); int V[N]; for (int i = 0; i < N; i++) { V[i] = rand(); } int ord[N]; iota(ord, ord+N, 0); sort(ord, ord+N, [&](const int &a, const int &b) { return V[a] < V[b]; }); map<int, int> m; for (int x = 0, i = 0; x < 60 && i < N; x++, i++) { int v = kth(ord[i]+1); if (m.find(v) == m.end() && x < 59) { m[v] = cnt(v); x++; } if (m[v] > N/3) { say_answer(v); return; } } say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...