| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 413875 | LouayFarah | 동굴 (IOI13_cave) | C++14 | 2085 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "cave.h"
using namespace std;
int tryCombination(int S[]);
void answer(int S[], int D[]);
vector<bool> visited;
void exploreCave(int N)
{
int S[N];
int D[N];
visited.assign(N, false);
for(int i = 0; i<N; i++)
{
S[i] = 0;
D[i] = i;
}
int res = tryCombination(S);
for(int door = 0; door<N; door++)
{
if(res==-1)
{
for(int i = 0; i<N; i++)
{
S[i] = 1 - S[i];
int d = tryCombination(S);
S[i] = 1 - S[i];
D[i] = d;
}
answer(S, D);
}
if(res==door)
{
for(int i = 0; i<N; i++)
{
if(!visited[i])
{
S[i] = 1 - S[i];
int curr = tryCombination(S);
S[i] = 1 - S[i];
if(curr!=door)
{
D[i] = door;
S[i] = 1 - S[i];
visited[i] = true;
res = curr;
break;
}
}
}
}
else
{
for(int i = 0; i<N; i++)
{
if(!visited[i])
{
S[i] = 1 - S[i];
int curr = tryCombination(S);
S[i] = 1 - S[i];
if(curr<=res)
{
D[i] = curr;
visited[i] = true;
}
/*if(curr==door)
{
D[i] = door;
visited[i] = true;
break;
}*/
}
}
door = res-1;
}
}
answer(S, D);
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
