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