Submission #524275

# Submission time Handle Problem Language Result Execution time Memory
524275 2022-02-09T01:10:12 Z maks007 CONSUL (info1cup19_consul) C++14
0 / 100
1 ms 456 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;
    	if(used[val]) {
    		val = *(s.begin());
    	}
    	int k = kth(val+1);
    	if(cnt(k) > n/3) {
    		say_answer(k);
    		return;
    	}
    	s.erase(s.find(val));
    	mp[k] ++;
    }

    say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 328 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 328 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 456 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -