Submission #280897

#TimeUsernameProblemLanguageResultExecution timeMemory
280897jairRSCave (IOI13_cave)C++17
0 / 100
14 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, newClosed; closed = tryCombination(c); while (closed != -1) { 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 if (newClosed < closed) { s[newClosed] = sw; unknown.erase(sw); c[sw] = invert(c[sw]); } } closed = tryCombination(c); } 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...