답안 #149896

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
149896 2019-09-01T07:21:47 Z 본인 하지만 안 어림 ㅋㅋ(#3569, gs13105, xdoju, gs13068) 로카히아 유적 (FXCUP4_lokahia) C++17
0 / 100
7 ms 640 KB
#include "lokahia.h"

int p[202];
int a[202];

int FindBase(int N){
	int i, j, k, t;
	for (i = 0; i < N; i++) {
		p[i] = 1;
		a[i] = i;
	}
	for (i = j = k = 0; i < N; i++) {
		if (k) {
			t = a[j] == a[i] ? CollectRelics(a[j], a[i]) : a[j];
			if (t == -1) k--;
			else {
				p[i] = 0;
				p[j]++;
				a[j] = t;
				k++;
			}
		}
		else {
			j = i;
			k = 1;
		}
	}
	if (!k) return -1;
	for (i = 0; i < j; i++) if (p[i]) {
		t = a[j] == a[i] ? CollectRelics(a[j], a[i]) : a[j];
		if (t != -1) {
			a[j] = t;
			p[j] += p[i];
		}
	}
	if (p[j] * 2 > N) return a[j];
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 640 KB Wrong
2 Incorrect 6 ms 640 KB Wrong
3 Incorrect 6 ms 640 KB Wrong
4 Incorrect 7 ms 640 KB Wrong
5 Incorrect 6 ms 640 KB Wrong
6 Incorrect 6 ms 640 KB Wrong
7 Incorrect 6 ms 640 KB Wrong
8 Incorrect 6 ms 640 KB Wrong
9 Incorrect 6 ms 640 KB Wrong
10 Incorrect 6 ms 512 KB Wrong
11 Incorrect 5 ms 512 KB Wrong
12 Incorrect 6 ms 512 KB Wrong
13 Correct 5 ms 384 KB Correct : C = 0
14 Incorrect 6 ms 512 KB Wrong
15 Incorrect 6 ms 640 KB Wrong
16 Incorrect 6 ms 600 KB Wrong
17 Incorrect 6 ms 640 KB Wrong
18 Incorrect 6 ms 640 KB Wrong
19 Incorrect 6 ms 640 KB Wrong
20 Incorrect 6 ms 640 KB Wrong
21 Incorrect 6 ms 640 KB Wrong
22 Incorrect 5 ms 512 KB Wrong
23 Incorrect 6 ms 512 KB Wrong
24 Incorrect 5 ms 512 KB Wrong
25 Incorrect 6 ms 640 KB Wrong
26 Incorrect 6 ms 512 KB Wrong
27 Incorrect 6 ms 512 KB Wrong