| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337826 | nagorn_ph | 동굴 (IOI13_cave) | C++20 | 610 ms | 536 KiB |
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
void exploreCave(int n) {
int s[n], d[n], ok[n];
for (int i = 0; i < n; i++) s[i] = d[i] = ok[i] = 0;
for (int i = 0; i < n; i++) {
int l = 0, r = n - 1;
int temp[n];
for (int j = 0; j < n; j++) {
if (ok[j]) temp[j] = s[j];
else temp[j] = 0;
}
int f = tryCombination(temp);
int cur = (f > i || f == -1 ? 0 : 1);
while (l < r) {
int mid = (l + r) / 2;
for (int j = 0; j < n; j++) {
if (ok[j]) temp[j] = s[j];
else temp[j] = (j >= l && j <= mid ? cur : 1 - cur);
}
f = tryCombination(temp);
if (f > i || f == -1) r = mid;
else l = mid + 1;
}
ok[l] = 1;
s[l] = cur;
d[l] = i;
}
answer(s, d);
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
