Submission #160476

#TimeUsernameProblemLanguageResultExecution timeMemory
160476BenqCONSUL (info1cup19_consul)C++14
100 / 100
46 ms376 KiB
#include "grader.h" #include <bits/stdc++.h> #define F0R(i,a) for (int i = 0; i < (a); ++i) #define pb push_back #define f first #define s second using namespace std; void solve(int n) { srand(2358198); map<int,int> m; F0R(i,30) { int ind = rand()%n+1; int x = kth(ind); m[x] ++; } vector<pair<int,int>> tri; for (auto& t: m) tri.pb({t.s,t.f}); sort(tri.rbegin(),tri.rend()); for (auto& t: tri) if (3*cnt(t.s) > n) { say_answer(t.s); return; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...