답안 #482673

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
482673 2021-10-26T03:17:05 Z rk42745417 CONSUL (info1cup19_consul) C++17
85 / 100
35 ms 344 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)));
	set<int> has;
	int tmp = 0;
	for(int a : arr) {
		int x = kth(a);
		tmp++;
		if(tmp == 60)
			break;
		if(has.count(x))
			continue;
		has.insert(x);
		int w = cnt(x);
		tmp++;
		if(w > n / 3) {
			say_answer(x);
			return;
		}
		if(tmp == 60)
			break;
	}
	say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 200 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 296 KB Output is correct
2 Correct 4 ms 280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 200 KB Output is correct
2 Correct 27 ms 200 KB Output is correct
3 Correct 6 ms 200 KB Output is correct
4 Correct 5 ms 344 KB Output is correct
5 Correct 27 ms 200 KB Output is correct
6 Correct 31 ms 200 KB Output is correct
7 Correct 19 ms 284 KB Output is correct
8 Correct 29 ms 200 KB Output is correct
9 Correct 30 ms 200 KB Output is correct
10 Correct 20 ms 200 KB Output is correct
11 Correct 35 ms 300 KB Output is correct
12 Correct 22 ms 200 KB Output is correct
13 Correct 24 ms 200 KB Output is correct
14 Correct 25 ms 200 KB Output is correct