Submission #125370

#TimeUsernameProblemLanguageResultExecution timeMemory
125370khulegubCave (IOI13_cave)C++14
12 / 100
330 ms516 KiB
#include "cave.h" #include <bits/stdc++.h> int n; bool lock[5005]; int s[5005], d[5005]; void soli(int l, int r){ for (int i = l; i <= r; i++) if(!lock[i]) s[i] = (s[i] ? 0 : 1); } void exploreCave(int N) { n = N; memset(s, 0, sizeof s); for (int i = 0; i < n; i++){ if(tryCombination(s) == i) soli(0, n - 1); int l = 0, r = n - 1; while (l != r){ int mid = (l + r) >> 1; soli(l, mid); int tmp = tryCombination(s); soli(l, mid); if(tmp == i){ //zuun tald r = mid; } else{ //baruun tald l = mid + 1; } } d[i] = l; lock[l] = 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...