Submission #1002230

#TimeUsernameProblemLanguageResultExecution timeMemory
1002230toast12Cave (IOI13_cave)C++14
33 / 100
18 ms528 KiB
#include <iostream> #include "cave.h" using namespace std; void exploreCave(int N) { int s[N], d[N]; for (int i = 0; i < N; i++) { s[i] = -1; d[i] = -1; } // iterate over all doors and find out which switch opens the ith door for (int i = 0; i < N; i++) { // find which switch unlocks door i for (int j = 0; j < N; j++) { if (s[j] != -1) continue; // try setting the current switch to down position s[j] = 0; int x = tryCombination(s); if (x == i+1 || x == -1) { // the current switch unlocks the current door d[j] = i; break; } // try setting the switch to up position s[j] = 1; x = tryCombination(s); if (x == i+1 || x == -1) { d[j] = i; break; } s[j] = -1; } } 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...