답안 #390250

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
390250 2021-04-15T15:58:29 Z mariowong CONSUL (info1cup19_consul) C++14
100 / 100
28 ms 544 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);
    for (int i=1;i<=25;i++){
    	pos=dis(gen)%n+1; 
		val=kth(pos);
    	if (m[val])
    	ct++;
    	else
    	{
    		m[val]=true;
    		if (cnt(val) > n/3){
    			say_answer(val);
    			return;
			}
    		ct+=2;
		}
    	
	}
	say_answer(-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 300 KB Output is correct
2 Correct 12 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 296 KB Output is correct
2 Correct 22 ms 300 KB Output is correct
3 Correct 9 ms 200 KB Output is correct
4 Correct 9 ms 200 KB Output is correct
5 Correct 16 ms 204 KB Output is correct
6 Correct 16 ms 292 KB Output is correct
7 Correct 18 ms 200 KB Output is correct
8 Correct 26 ms 296 KB Output is correct
9 Correct 24 ms 296 KB Output is correct
10 Correct 23 ms 296 KB Output is correct
11 Correct 25 ms 544 KB Output is correct
12 Correct 28 ms 200 KB Output is correct
13 Correct 27 ms 280 KB Output is correct
14 Correct 22 ms 200 KB Output is correct