# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
97111 | E869120 | Cave (IOI13_cave) | C++14 | 1334 ms | 640 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;
int S[5000], A[5009], B[5009], col[5009];
void exploreCave(int N) {
for (int i = 0; i < N; i++) col[i] = -1;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (col[j] == -1) S[j] = 0;
else S[j] = col[j];
}
int Z = tryCombination(S);
int L = 0, R = N, M, res = 0;
while (R - L >= 2) {
M = (L + R) / 2;
for (int j = 0; j < N; j++) {
if (col[j] == -1) { if (L <= j && j < M) S[j] = 1; else S[j] = 0; }
else S[j] = col[j];
}
int ZZ = tryCombination(S);
bool ok1 = true; if (Z == i) ok1 = false;
bool ok2 = true; if (ZZ == i) ok2 = false;
if (ok1 != ok2) { res = L; R = M; }
if (ok1 == ok2) { res = M; L = M; }
}
if (Z == i) {
# | 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... |