Submission #315018

# Submission time Handle Problem Language Result Execution time Memory
315018 2020-10-22T00:38:55 Z Kevin_Zhang_TW CONSUL (info1cup19_consul) C++17
0 / 100
10 ms 384 KB
#include "grader.h"
#include<bits/stdc++.h>
#define pb emplace_back
#define AI(i) begin(i), end(i)
using namespace std;
using ll = long long;

#ifdef KEV
#define DE(args...) kout("[ " + string(#args) + " ] = ", args)
void debug(auto L, auto R) { while (L < R) cerr << *L << " \n"[L+1==R], ++L; }
void kout(){ cerr << endl; }
template<class T1, class ...T2> void kout(T1 a, T2 ...e) { cerr << a << ' ', kout(e...); }

int cnt(int x) { return 1; }
void say_answer(int v) { cerr << "Ans is " << v << '\n'; }
int kth(int i) { return 1; }

#else
#define DE(...) 0
#define deubg(...) 0
#endif
const int MAX_N = 300010;

random_device rd;
mt19937 gen(rd());
void solve(int n)
{
	uniform_int_distribution<int> dis(0, n-1);

	const int lim = min(n, 60);
	unordered_set<int> test;
	int cur_cnt = 0;
	while (cur_cnt + 2 <= lim) {
		int x = kth(dis(gen));
		if (test.count(x))
			continue;
		test.insert(x);
		if (cnt(x) > n / 3) {
			say_answer(x);
			return ;
		}
	}
	say_answer(-1);
	return;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Wrong query format
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Wrong query format
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 384 KB Wrong query format
2 Halted 0 ms 0 KB -