# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954451 | __Davit__ | Cave (IOI13_cave) | C++17 | 24 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
}
void exploreCave(int N) {
int a[N];
for (int i = 0; i < N; i++)a[i] = 0;
int x = tryCombination(a);
while (x != -1) {
int ina = 0, inb = N - 1, ans;
while (ina <= inb) {
int mid = (ina + inb) >> 1;
for (int i = 0; i <= mid; i++)a[i] ^= 1;
int y = tryCombination(a);
if (x != y) {
inb = mid - 1;
ans = mid;
} else {
ina = mid + 1;
}
for (int i = 0; i <= mid; i++)a[i] ^= 1;
}
a[ans] ^= 1;
x = tryCombination(a);
}
int b[N];
for (int i = 0; i < N; i++) {
a[i] ^= 1;
int x = tryCombination(a);
a[i] ^= 1;
b[i] = x;
}
answer(a, b);
}
Compilation message (stderr)
# | 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... |