# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
97968 | AlexLuchianov | 동굴 (IOI13_cave) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include "cave.h"
using namespace std;
/*
void answer(int S[], int D[]){
}
*/
/*
int tryCombination(int S[]){
}
*/
void voidexploreCave(int n) {
int *door[n] = {0}, *per[n] = {0}, *seen[n] = {0};
for(int i = 0; i < n; i++){
int from = 0, to = n - 1;
if(i < tryCombination(door))
for(int j = 0; j < n; j++)
if(seen[j] == 0)
door[j] ^= 1;
while(from < to){
int mid = (from + to + 1) / 2;
for(int j = 0; j < mid; j++)
if(seen[j] == 0)
door[j] ^= 1;
if(i < tryCombination(door)){
to = mid - 1;
} else
from = mid;
for(int j = 0; j < mid; j++)
if(seen[j] == 0)
door[j] ^= 1;
}
per[from] = i;
seen[from] = 1;
}
answer(door, per);
}