답안 #72007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
72007 2018-08-26T04:37:04 Z 우리는 진실을 잊고 살잖아~~~(#2195, leejseo, king114) 마법 다우징 (FXCUP3_magic) C++17
60 / 100
4 ms 376 KB
#include "dowsing.h"
//#include <iostream>
//using namespace std;

bool B[101][101];

void FindTreasure(int N) {
	int i, tmp = 0, ai, aj;
	for (i=1; i<=N; i++){
		B[1][i] = Detect(1, i);
		if (B[1][i]) ++tmp;
		if (i > 2 && tmp == 1) break;
		if (tmp > 1) break;
	}
	if (tmp == 1){
		if (B[1][1]) aj = 1;
		else{
			if (B[1][2]) aj = 2;
			else aj = i;
		}
		for (i=1; i<=N; i++){
			if (!Detect(i, aj)){
				Report(i, aj);
				//cout << i << ' ' << aj << endl;
				return;
			}
		}
	}
	else{
		ai = 1;
		for (i=1; i<=N; i++){
			if (!Detect(ai, i)){
				Report(ai, i);
				return;
			}
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Correct : C = 5
2 Correct 2 ms 256 KB Correct : C = 5
3 Partially correct 3 ms 376 KB Partially correct : C = 197
4 Partially correct 3 ms 376 KB Partially correct : C = 196
5 Partially correct 3 ms 376 KB Partially correct : C = 199
6 Partially correct 4 ms 376 KB Partially correct : C = 198
7 Partially correct 4 ms 376 KB Partially correct : C = 195
8 Partially correct 3 ms 376 KB Partially correct : C = 195
9 Partially correct 4 ms 376 KB Partially correct : C = 198
10 Partially correct 3 ms 376 KB Partially correct : C = 200
11 Partially correct 3 ms 376 KB Partially correct : C = 194
12 Partially correct 3 ms 376 KB Partially correct : C = 196