답안 #390245

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
390245 2021-04-15T15:56:50 Z mariowong CONSUL (info1cup19_consul) C++14
100 / 100
34 ms 200 KB
#include "grader.h"
#include <bits/stdc++.h>

using namespace std;

int val,pos,ct,x,a[15];
map <int,int> m,now;
void solve(int n){
    mt19937 gen(time(NULL));
    uniform_int_distribution <int> dis(1,1e9);
    now[0]=true;
    for (int i=1;i<=25;i++){
    	pos=dis(gen)%n+1; 
		val=kth(pos);
    	if (cnt(val) > n/3){
    		say_answer(val);
    		return;
		}
	}
	say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 200 KB Output is correct
2 Correct 7 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 200 KB Output is correct
2 Correct 19 ms 200 KB Output is correct
3 Correct 9 ms 200 KB Output is correct
4 Correct 9 ms 200 KB Output is correct
5 Correct 20 ms 200 KB Output is correct
6 Correct 28 ms 200 KB Output is correct
7 Correct 20 ms 200 KB Output is correct
8 Correct 34 ms 200 KB Output is correct
9 Correct 27 ms 200 KB Output is correct
10 Correct 22 ms 200 KB Output is correct
11 Correct 21 ms 200 KB Output is correct
12 Correct 21 ms 200 KB Output is correct
13 Correct 31 ms 200 KB Output is correct
14 Correct 27 ms 200 KB Output is correct