제출 #992803

#제출 시각아이디문제언어결과실행 시간메모리
992803Muaath_5동굴 (IOI13_cave)C++17
13 / 100
257 ms544 KiB
#include "cave.h" #include <bits/stdc++.h> void exploreCave(int n) { int sure[n] = {}; int correct[n] = {}; int index[n] = {}; for (int i = 0; i < n; i++) { int l = 0, r = n-1; while (l < r) { const int mid = (l+r)/2; int cpy[n]; for (int i = 0; i < n; i++) cpy[i] = correct[i]; for (int i = mid+1; i < n; i++) if (!sure[i]) cpy[i] = 1; if (tryCombination(cpy) == i) l = mid+1; else r = mid; } index[i] = l; sure[l] = 1; } int idx[n] = {}; for (int i = 0; i < n; i++) idx[index[i]] = i; answer(correct, idx); }
#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...