| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1337691 | kantaponz | 동굴 (IOI13_cave) | C++20 | 175 ms | 524 KiB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
const int nx = 5e4 + 5;
int R[nx], D[nx], n;
bool vis[nx];
void change(int u, int v) {
for (; u <= v; u++) {
if (vis[u]) continue;
R[u] = (R[u] + 1) % 2;
}
}
void exploreCave(int N) {
n = N;
for (int i = 0; i <= n - 1; i++) {
int l = 0, r = n - 1;
int res = tryCombination(R);
int s = (res > i || res == -1 ? 0 : 1);
while (l < r) {
int m = (l + r) / 2;
change(l, m);
res = tryCombination(R);
int ps = (res > i || res == -1 ? 0 : 1);
change(l, m);
if (ps == s) {
l = m + 1;
} else {
r = m;
}
}
R[l] = s;
D[l] = i;
vis[l] = 1;
}
answer(R, 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... | ||||
