답안 #151697

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151697 2019-09-04T07:56:52 Z gs14004 로카히아 유적 (FXCUP4_lokahia) C++17
77 / 100
3 ms 676 KB
#include "lokahia.h"

int FindBase(int N){
	int who = 0;
	int cnt = 0;
	for(int i=0; i<N; i++){
		if(cnt == 0){
			who = i;
			cnt = 1;
			continue;
		}
		int query = (who == i ? who : CollectRelics(who, i));
		if(query == -1) cnt--;
		else{
			who = query;
			cnt++;
		}
	}
	cnt = 0;
	for(int i=0; i<N; i++){
		int cr = (who == i ? who : CollectRelics(who, i));
		if(cr != -1){
			who = cr;
			cnt++;
		}
	}
	if(cnt >= N / 2 + 1) return who;
	return -1;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 3 ms 632 KB Partially correct : C = 385
2 Correct 2 ms 632 KB Correct : C = 228
3 Correct 2 ms 632 KB Correct : C = 179
4 Correct 2 ms 504 KB Correct : C = 225
5 Correct 2 ms 632 KB Correct : C = 237
6 Partially correct 2 ms 504 KB Partially correct : C = 395
7 Correct 2 ms 504 KB Correct : C = 0
8 Correct 2 ms 632 KB Correct : C = 234
9 Partially correct 3 ms 552 KB Partially correct : C = 388
10 Correct 2 ms 376 KB Correct : C = 8
11 Correct 2 ms 632 KB Correct : C = 177
12 Correct 2 ms 504 KB Correct : C = 223
13 Partially correct 2 ms 508 KB Partially correct : C = 397
14 Partially correct 2 ms 504 KB Partially correct : C = 379
15 Partially correct 2 ms 508 KB Partially correct : C = 310
16 Correct 2 ms 632 KB Correct : C = 228
17 Partially correct 2 ms 504 KB Partially correct : C = 384
18 Partially correct 2 ms 632 KB Partially correct : C = 385
19 Partially correct 3 ms 676 KB Partially correct : C = 395
20 Correct 2 ms 632 KB Correct : C = 297
21 Partially correct 2 ms 636 KB Partially correct : C = 397
22 Partially correct 3 ms 504 KB Partially correct : C = 388
23 Correct 2 ms 504 KB Correct : C = 299
24 Correct 2 ms 504 KB Correct : C = 235
25 Correct 2 ms 504 KB Correct : C = 235
26 Partially correct 3 ms 632 KB Partially correct : C = 383
27 Partially correct 3 ms 564 KB Partially correct : C = 317