# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76366 | Sherazin | Cave (IOI13_cave) | C++14 | 65 ms | 512 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;
const int N = 5e3+5;
int n;
bitset<N> chk;
int S[N], D[N];
void exploreCave(int _n) {
n = _n;
int t;
for(int i = 0; i < n; i++) {
t = tryCombination(S);
bool s = (t == -1 || t > i);
int l = 0, r = n-1;
while(l < r) {
int m = (l+r) >> 1;
for(int j = l; j <= r; j++) if(!chk[j]) S[j] ^= 1;
int a = tryCombination(S), e = (a == -1 || a > i);
if(t ^ a) r = m;
else l = m+1;
}
if(t == i) S[l] ^= 1;
chk[l] = 1;
D[l] = i;
}
answer(S, D);
}
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... |