Submission #280891

#TimeUsernameProblemLanguageResultExecution timeMemory
280891jairRSCave (IOI13_cave)C++17
0 / 100
12 ms640 KiB
#include "cave.h" #include <vector> #include <set> using namespace std; int c[5000]; int s[5000]; int invert(int bit) { return bit * -1 + 1; } void exploreCave(int N) { set<int> unknown; for (int i = 0; i < N; i++) { unknown.insert(i); } int closed = 0, newClosed; while (closed != -1) { closed = tryCombination(c); for (int sw : unknown) { c[sw] = invert(c[sw]); newClosed = tryCombination(c); if (newClosed > closed || newClosed == -1) { s[closed] = sw; unknown.erase(sw); break; } else { s[newClosed] = sw; unknown.erase(sw); c[sw] = invert(c[sw]); } } } answer(c, s); }
#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...