Submission #376115

#TimeUsernameProblemLanguageResultExecution timeMemory
376115gustasonCave (IOI13_cave)C++14
0 / 100
92 ms364 KiB
#include "cave.h" void exploreCave(int N) { int S[N], D[N]; for(int i = 0; i < N; i++) { S[i] = 0; D[i] = -1; } for(int i = 0; i < N; i++) { int x = tryCombination(S); if (x <= i && x != -1) { for(int i = 0; i < N; i++) { if (D[i] != -1) continue; S[i] ^= 1; } } int l = 0, r = N-1, ans = r-1; while(l <= r) { int mid = (l + r) / 2; ans = mid; for(int i = l; i <= mid; i++) { if (D[i] != -1) continue; S[i] ^= 1; } x = tryCombination(S); if (x <= i && x != -1) { r = mid - 1; } else { l = mid + 1; } for(int i = l; i <= mid; i++) { if (D[i] != -1) continue; S[i] ^= 1; } } D[ans] = i; // S[ans] ^= 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...