Submission #413790

#TimeUsernameProblemLanguageResultExecution timeMemory
413790LouayFarahCave (IOI13_cave)C++14
33 / 100
135 ms456 KiB
#include "bits/stdc++.h" #include "cave.h" using namespace std; int tryCombination(int S[]); void answer(int S[], int D[]); vector<bool> visited; void exploreCave(int N) { int S[N]; int D[N]; visited.assign(N, false); for(int i = 0; i<N; i++) { S[i] = 0; D[i] = i; } for(int door = 0; door<N; door++) { int res = tryCombination(S); if(res==door) { for(int i = 0; i<N; i++) { if(!visited[i]) { S[i] = 1 - S[i]; int curr = tryCombination(S); S[i] = 1 - S[i]; if(curr!=door) { D[i] = door; S[i] = 1 - S[i]; visited[i] = true; break; } } } } else { for(int i = 0; i<N; i++) { if(!visited[i]) { S[i] = 1 - S[i]; int curr = tryCombination(S); S[i] = 1 - S[i]; if(curr==door) { D[i] = door; visited[i] = true; break; } } } } } answer(S, 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...