답안 #149332

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149332 2019-09-01T06:15:58 Z 서울대학교 연구공원 944동 삼성전자서울대연구소(#3600, ho94949, dotorya, zigui) 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
1000 ms 640 KB
#include "lokahia.h"

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

mt19937_64 rng(0x94949);
int R(int a, int b)
{
	return uniform_int_distribution<int>(a, b)(rng);
}

int FindBase(int N){
	vector<int> cnt(N);
	for(int i=0; i<300-N+1; ++i)
	{
		int v1, v2;
		do
		{
			v1 = R(0, N-1);
			v2 = R(0, N-1);
		} while (v1==v2);
		int x = CollectRelics(v1, v2);
		if(x != -1) cnt[x] ++;
	}

	int maxi = max_element(cnt.begin(), cnt.end()) - cnt.begin();
	int cc = 1;
	for(int i=0; i<N; ++i)
		if(i != maxi && -1 != CollectRelics(maxi, i))
			++cc;
	if(cc > N/2) return maxi;
	else return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 640 KB Correct : C = 300
2 Correct 5 ms 640 KB Correct : C = 300
3 Correct 6 ms 640 KB Correct : C = 300
4 Correct 6 ms 640 KB Correct : C = 300
5 Correct 9 ms 640 KB Correct : C = 300
6 Correct 7 ms 640 KB Correct : C = 300
7 Correct 7 ms 640 KB Correct : C = 300
8 Execution timed out 3095 ms 640 KB Time limit exceeded
9 Correct 6 ms 640 KB Correct : C = 300
10 Correct 6 ms 512 KB Correct : C = 300
11 Correct 6 ms 512 KB Correct : C = 300
12 Correct 6 ms 608 KB Correct : C = 300
13 Correct 6 ms 512 KB Correct : C = 300
14 Correct 7 ms 600 KB Correct : C = 300
15 Correct 7 ms 512 KB Correct : C = 300
16 Correct 7 ms 640 KB Correct : C = 300
17 Correct 7 ms 640 KB Correct : C = 300
18 Correct 7 ms 640 KB Correct : C = 300
19 Correct 6 ms 600 KB Correct : C = 300
20 Incorrect 7 ms 640 KB Wrong
21 Correct 6 ms 640 KB Correct : C = 300
22 Incorrect 6 ms 600 KB Wrong
23 Correct 6 ms 512 KB Correct : C = 300
24 Correct 6 ms 512 KB Correct : C = 300
25 Correct 6 ms 512 KB Correct : C = 300
26 Correct 6 ms 640 KB Correct : C = 300
27 Correct 6 ms 600 KB Correct : C = 300