제출 #420267

#제출 시각아이디문제언어결과실행 시간메모리
420267SuhaibSawalha1동굴 (IOI13_cave)C++17
0 / 100
733 ms428 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int a[N] = {}, D[N], P[N] = {}; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { if (!P[j]) { a[j] = 0; } } int right = tryCombination(a) != i; cout << right << endl; int l = 0, r = N - 1; while (l < r) { int mid = (l + r) / 2; for (int j = 0; j < N; ++j) { if (!P[j]) { a[j] = j <= mid ? right : !right; } } if (tryCombination(a) == i) { r = mid; } else { l = mid + 1; } } D[l] = i; a[l] = !right; P[l] = 1; } answer(a, 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...