Submission #341977

# Submission time Handle Problem Language Result Execution time Memory
341977 2020-12-31T21:16:57 Z cheissmart CONSUL (info1cup19_consul) C++14
0 / 100
1 ms 364 KB
#include "grader.h"
#ifdef CHEISSMART
#include "grader.cpp"
#endif
#include <bits/stdc++.h>

using namespace std;

void solve(int n) {
	set<int> asked;
	int qry = 0;
	auto is = [&] (int i) {
		int x = kth(i);
		qry++;
		if(asked.count(x)) return -1;
		asked.insert(x);
		qry++;
		if(cnt(x) * 3 > n) return x;
		else return -1;
	};
	mt19937 rng(time(0));
	while(qry + 2 <= 60) {
		int pos = rng() % n + 1;
		int r = is(pos);
		if(r != -1) say_answer(r);
	}
 	say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Multiple answers provided for the same testcase!
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Multiple answers provided for the same testcase!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Multiple answers provided for the same testcase!
2 Halted 0 ms 0 KB -