| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1344830 | sdan | Cave (IOI13_cave) | C++20 | 31 ms | 500 KiB |
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
void exploreCave(int n) {
int s[n], d[n]; for(int i = 0; i < n; ++i) s[i] = 0, d[i] = -1;
int k = -1;
for(int i = 0; i < n; ++i) {
k = tryCombination(s);
if(k != i) for(int j = 0; j < n; ++j)
if(d[j] == -1) s[j] = s[j] ^ 1;
int l = 0, r = n, mod;
while(l + 1 < r) {
int m = (l + r) / 2;
for(int j = l; j < m; ++j)
if(d[j] == -1) s[j] = s[j] ^ 1;
k = tryCombination(s);
if(k == i) l = m, mod = 1;
else {
for(int j = l; j < m; ++j)
if(d[j] == -1) s[j] = s[j] ^ 1;
r = m, mod = 0;
}
}
d[l] = i;
if(mod) s[l] = s[l] ^ 1;
}
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... | ||||
