# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
17461 | kdh9949 | Cave (IOI13_cave) | C++98 | 1685 ms | 592 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"
int ans[5010], sw[5010], chk[5010];
bool havethisbit(int x, int d){
return (x & (1 << d)) != 0;
}
void exploreCave(int N) {
int n = N;
if(n == 1){
ans[0] = 0;
sw[0] = 0;
if(tryCombination(sw) != -1) sw[0] = 1;
answer(sw, ans);
return;
}
int maxbit;
for(maxbit = 0; (1 << maxbit) < n; maxbit++);
int curans, cursw = 0;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(chk[j]) continue;
else sw[j] = 0;
}
if(tryCombination(sw) == i) curans = 1;
else curans = 0;
for(int j = 0; j < maxbit; j++){
for(int k = 0; k < n; k++){
if(chk[k]) continue;
# | 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... |