제출 #482617

#제출 시각아이디문제언어결과실행 시간메모리
482617thiago_bastos동굴 (IOI13_cave)C++17
0 / 100
35 ms332 KiB
#include "cave.h"
 
const int MAXN = 5000;
 
int S[MAXN], B[MAXN], D[MAXN];
 
void exploreCave(int N) {
	for(int i = 0; i < N; ++i) S[i] = 0;
	
	int door = tryCombination(S);
	
	while(door >= 0) {
		for(int j = 0; j < N; ++j) {
			S[j] ^= 1;
			int ans = tryCombination(S);
			if(ans > door || ans < 0) {
              	door = ans;
                break;
            }
			S[j] ^= 1;
		}
	}
	
	for(int i = 0; i < N; ++i) B[i] = S[i] ^ 1;
 
	for(int i = 0; i < N; ++i) {
		S[i] ^= 1;
		D[i] = tryCombination(S);
		S[i] ^= 1;
	}
	
	answer(B, D);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...