제출 #988729

#제출 시각아이디문제언어결과실행 시간메모리
988729Ariadna동굴 (IOI13_cave)C++14
0 / 100
362 ms348 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; int s[5000]; int pos[5000]; int door[5000]; void exploreCave(int N) { for (int d = 0; d < N; ++d) { int correct_pos = 0; for (int i = 0; i < N; ++i) if (pos[i] != -1) s[i] = pos[i]; else s[i] = 0; if (tryCombination(s) == d) correct_pos = 1; int l = 0, r = N; while (l < r-1) { int m = (l+r)/2; for (int i = 0; i < N; ++i) { if (pos[i] != -1) s[i] = pos[i]; else if (i < m) s[i] = correct_pos; else s[i] = 1-correct_pos; } int res = tryCombination(s); if (res > d || res == -1) { r = m; } else { l = m; } } pos[l] = correct_pos; door[l] = d; } answer(pos, door); }
#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...