Submission #1263250

#TimeUsernameProblemLanguageResultExecution timeMemory
1263250bluevioletCave (IOI13_cave)C++20
0 / 100
1 ms324 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; const int Inf = (int)2e9 + 7; int s[5009], d[5009]; bool vst[5009]; set<int> st; void exploreCave(int N) { st.clear(); int n = N; for (int i = 0; i < N; i++) { s[i] = 0; d[i] = 0; } while (true) { int firstClosed = tryCombination(s); if (firstClosed == -1) break; for (int i=0; i<n; i++) { s[i] ^= 1; if (vst[i]) continue; int pp = tryCombination(s); if (pp == -1) pp = Inf; if (pp > firstClosed) { d[i] = firstClosed; vst[i] = true; break; } else s[i] ^= 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...