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"
const int SZ = 5010;
int s[SZ];
int d[SZ];
void exploreCave(int N) {
for(int i = 0; i < N; ++i){
s[i] = 1;
}
int v = tryCombination(s);
while(v != -1){
int l = 0, r = N - 1;
while(l <= r){
if(l == r) break;
int mid = (l + r) >> 1;
for(int i = l; i <= mid; ++i){
s[i] ^= 1;
}
int t = tryCombination(s);
for(int i = l; i <= mid; ++i){
s[i] ^= 1;
}
if(t > v) r = mid - 1;
else l = mid + 1;
}
s[l] ^= 1;
v = tryCombination(s);
} for(int i = 0; i < N; ++i){
s[i] ^= 1;
d[i] = tryCombination(s);
s[i] ^= 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... |