Submission #474388

# Submission time Handle Problem Language Result Execution time Memory
474388 2021-09-18T06:53:41 Z hhhhaura CONSUL (info1cup19_consul) C++14
100 / 100
29 ms 232 KB
#include "grader.h"
#define wiwihorz
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i <= b; i ++)
using namespace std;
void solve(int n) {
    set<int> s;
    rep(i, 1, 25) {
    	int k;
    	while(k = rand() % n + 1, s.find(k) != s.end());
    	s.insert(k);
    	k = kth(k);
    	if(cnt(k) > n / 3) {
    		say_answer(k);
    		return;
    	}
    }
    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Correct 17 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 200 KB Output is correct
2 Correct 9 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 200 KB Output is correct
2 Correct 19 ms 200 KB Output is correct
3 Correct 4 ms 200 KB Output is correct
4 Correct 7 ms 200 KB Output is correct
5 Correct 25 ms 200 KB Output is correct
6 Correct 21 ms 200 KB Output is correct
7 Correct 26 ms 200 KB Output is correct
8 Correct 22 ms 200 KB Output is correct
9 Correct 18 ms 232 KB Output is correct
10 Correct 29 ms 200 KB Output is correct
11 Correct 19 ms 200 KB Output is correct
12 Correct 25 ms 200 KB Output is correct
13 Correct 27 ms 200 KB Output is correct
14 Correct 25 ms 200 KB Output is correct