이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "cave.h"
using namespace std;
void exploreCave(int n) {
int v[n],d[n],s[n];
memset(v, 0, sizeof v);
memset(d, 0, sizeof d);
memset(s, 0, sizeof s);
if(tryCombination(d) == -1 && n > 100){
for(int i = 0; i < n; i++){
d[i] = 1;
s[i] = tryCombination(s);
d[i] = 0;
}
answer(d, s);
return;
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = 0;
}
}
int x = tryCombination(d), what = 0;
if(x == i) what = 1;
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = !what;
}
}
for(int j = 0; j < n; j++){
if(!v[j]){
d[j] = what;
int ii = tryCombination(d);
if(ii == -1 or ii > i){
s[j] = i;
v[j] = 1;
break;
}
d[j] = !what;
}
}
}
answer(d, s);
}
| # | 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... |