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[5005], curs[5005], door[5005];
void exploreCave(int N) {
fill(s, s+N, -1);
for(int i = 0; i < N; ++i){
fill(curs, curs+N, 0);
for(int k = 0; k < N; ++k) if(~s[k]) curs[k] = s[k];
int d = 0, state = (tryCombination(curs) >= i);
// state = 0 : closed
// state = 1 : open
for(int j = 12; j >= 0; --j){
for(int k = d; k < min(d + (1<<j), N); ++k){
if(~s[k]) curs[k] = s[k];
curs[k] = 1;
}
int cstate = (tryCombination(curs) >= i);
if(cstate == state) d += (1<<j);
}
door[d] = i;
s[d] = (state ? 0 : 1);
}
answer(s, door);
}
# | 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... |