Submission #414065

#TimeUsernameProblemLanguageResultExecution timeMemory
414065illyakrCave (IOI13_cave)C++14
0 / 100
222 ms452 KiB
#include "cave.h" int S[101010]; int D[101010]; bool dont[101010]; void sw(int l, int r) { for (int i = l; i <= r; i++) { if (dont[i])continue; S[i] ^= 1; } } void exploreCave(int N) { for (int i = 0; i < N; i++) { int gg = tryCombination(S); if (gg == -1 || gg >= i); else sw(0, N - 1); int l = 0, r = N - 1; while (l < r) { int mid = (l + r) / 2; sw(l, mid); gg = tryCombination(S); if (gg == -1 || gg >= i)l = mid + 1; else { sw(l, mid); r = mid; } } D[l] = i; dont[l] = true; } 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...