Submission #482611

#TimeUsernameProblemLanguageResultExecution timeMemory
482611thiago_bastosCave (IOI13_cave)C++17
0 / 100
8 ms340 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 && door >= 0; ++j) {
			S[j] ^= 1;
			int ans = tryCombination(S);
			if(ans > door || ans < 0) S[j] ^= 1;
			door = ans;
			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...