Submission #524276

# Submission time Handle Problem Language Result Execution time Memory
524276 2022-02-09T01:11:10 Z maks007 CONSUL (info1cup19_consul) C++14
85 / 100
37 ms 384 KB
#include <bits/stdc++.h>
#include <map>
#include "grader.h"
using namespace std;

void solve(int n)
{
	srand(time(0));
	map <int,int> mp;
	vector <int> used(n);
	set <int> s;
	for(int i = 0; i< n; i ++) s.insert(i);
    for(int i = 0; i < 30; i ++) {
    	int val = rand() % n;
    	
    	int k = kth(val+1);
    	if(cnt(k) > n/3) {
    		say_answer(k);
    		return;
    	}
    	mp[k] ++;
    }

    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 200 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 9 ms 292 KB Output is correct
2 Correct 8 ms 200 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 328 KB Output is correct
2 Correct 36 ms 328 KB Output is correct
3 Correct 17 ms 264 KB Output is correct
4 Correct 17 ms 328 KB Output is correct
5 Correct 33 ms 328 KB Output is correct
6 Correct 34 ms 260 KB Output is correct
7 Correct 31 ms 276 KB Output is correct
8 Correct 33 ms 276 KB Output is correct
9 Correct 37 ms 284 KB Output is correct
10 Correct 28 ms 320 KB Output is correct
11 Correct 36 ms 200 KB Output is correct
12 Correct 23 ms 280 KB Output is correct
13 Correct 22 ms 384 KB Output is correct
14 Correct 29 ms 328 KB Output is correct