Submission #160476

# Submission time Handle Problem Language Result Execution time Memory
160476 2019-10-27T14:43:34 Z Benq CONSUL (info1cup19_consul) C++14
100 / 100
46 ms 376 KB
#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 time Memory Grader output
1 Correct 36 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 42 ms 248 KB Output is correct
2 Correct 38 ms 252 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 45 ms 376 KB Output is correct
2 Correct 36 ms 252 KB Output is correct
3 Correct 39 ms 248 KB Output is correct
4 Correct 37 ms 376 KB Output is correct
5 Correct 40 ms 248 KB Output is correct
6 Correct 42 ms 248 KB Output is correct
7 Correct 20 ms 248 KB Output is correct
8 Correct 19 ms 376 KB Output is correct
9 Correct 37 ms 248 KB Output is correct
10 Correct 40 ms 376 KB Output is correct
11 Correct 43 ms 376 KB Output is correct
12 Correct 18 ms 248 KB Output is correct
13 Correct 30 ms 376 KB Output is correct
14 Correct 46 ms 248 KB Output is correct