Submission #482672

# Submission time Handle Problem Language Result Execution time Memory
482672 2021-10-26T03:14:45 Z rk42745417 CONSUL (info1cup19_consul) C++17
0 / 100
1 ms 424 KB
#include "grader.h"

#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = ll(2e18) + ll(1e15);
const double EPS = 1e-8;

void solve(int n) {
	vector<int> arr(n);
	for(int i = 0; i < n; i++)
		arr[i] = i + 1;
	shuffle(arr.begin(), arr.end(), mt19937(time(0)));
	vector<bool> has(n + 1);
	int tmp = 0;
	for(int a : arr) {
		int x = kth(a);
		tmp++;
		if(tmp == 60)
			break;
		if(has[x])
			continue;
		has[x] = true;
		int w = cnt(x);
		tmp++;
		if(w > n / 3) {
			say_answer(x);
			return;
		}
		if(tmp == 60)
			break;
	}
	say_answer(-1);
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 424 KB Execution killed with signal 11
# 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 328 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -