답안 #170469

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
170469 2019-12-25T11:30:03 Z Mounir CONSUL (info1cup19_consul) C++14
100 / 100
28 ms 504 KB
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
 
 
int kth(int k);
void say_answer(int k);
int cnt(int k);
 
void solve(int N){
	srand(42);
	
	int i = 0;
	set<int> faits;
	
	while (i < 25){
		int cur = kth((int)rand()%N + 1);
		if (true){
		//	cout << cur << endl;
			int nCur = cnt(cur);
			if (nCur > N/3){
				say_answer(cur);
				return;
			}
			faits.insert(cur);
		}
      i++;
	}
	say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 13 ms 248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 376 KB Output is correct
2 Correct 8 ms 248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 248 KB Output is correct
2 Correct 25 ms 248 KB Output is correct
3 Correct 10 ms 404 KB Output is correct
4 Correct 9 ms 248 KB Output is correct
5 Correct 11 ms 504 KB Output is correct
6 Correct 26 ms 248 KB Output is correct
7 Correct 25 ms 248 KB Output is correct
8 Correct 28 ms 308 KB Output is correct
9 Correct 18 ms 248 KB Output is correct
10 Correct 23 ms 248 KB Output is correct
11 Correct 25 ms 248 KB Output is correct
12 Correct 24 ms 248 KB Output is correct
13 Correct 26 ms 248 KB Output is correct
14 Correct 23 ms 376 KB Output is correct