제출 #280926

#제출 시각아이디문제언어결과실행 시간메모리
280926jairRS동굴 (IOI13_cave)C++17
46 / 100
33 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[sw] = closed; unknown.erase(sw); break; } else if (newClosed < closed) { s[sw] = newClosed; unknown.erase(sw); c[sw] = invert(c[sw]); } } closed = tryCombination(c); } for (int sw : unknown) { c[sw] = invert(c[sw]); closed = tryCombination(c); s[sw] = closed; 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...