# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1171727 | LaMatematica14 | Cave (IOI13_cave) | C++20 | 126 ms | 764 KiB |
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
vector<int> r(N, -1);
int logn = 31-__builtin_clz(N);
int bp[logn][N];
for (int i = 0; i < logn; i++) {
for (int j = 0; j < N; j++) {
bp[i][j] = j&(1<<logn);
}
}
int z[N];
for (int i = 0; i < N; i++) z[i] = 0;
int ans[N];
for (int i = 0; i < N; i++) {
bool d = tryCombination(z) == i;
ans[i] = 0;
for (int j = 0; j < logn; j++) ans[i] += (tryCombination(bp[j])==i)^d ? (1<<j) : 0;
for (int j = 0; j < logn; j++) bp[j][ans[i]] = d;
z[ans[i]] = d;
}
answer(z, ans);
}
# | 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... |