| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 168423 | tri | Cave (IOI13_cave) | C++14 | 358 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
#define pb push_back
#define f first
#define s second
int state[10000];
int door[10000];
int find(int cDoor, vi &cand) {
if (cand.size() == 1) {
return cand[0];
}
int oFClosed = tryCombination(state);
for (int i = 0; i < cand.size() / 2; i++) {
state[cand[i]] = 1;
}
int nFClosed = tryCombination(state);
for (int i = 0; i < cand.size() / 2; i++) {
state[cand[i]] = 0;
}
vi nCand;
if ((oFClosed == cDoor) == (nFClosed == cDoor)) {
for (int i = cand.size() / 2; i < cand.size(); i++) {
nCand.pb(cand[i]);
}
} else {
for (int i = 0; i < cand.size() / 2; i++) {
nCand.pb(cand[i]);
}
}
return find(cDoor, nCand);
}
int fPos(int x) {
state[x] = 0;
int fClosed = tryCombination(state);
if (fClosed == -1 || door[x] < fClosed) {
return 0;
} else {
return 1;
}
}
void exploreCave(int N) {
vi cand;
for (int i = 0; i < N; i++) {
cand.pb(i);
}
memset(state, 0, sizeof(state));
memset(door, 0, sizeof(door));
for (int doorI = 0; doorI < N; doorI++) {
int switchI = find(doorI, cand);
door[switchI] = doorI;
state[switchI] = fPos(switchI);
for (int j = 0; j < cand.size(); j++) {
if (cand[j] == switchI) {
cand.erase(cand.begin() + j);
break;
}
}
}
answer(state, door);
}컴파일 시 표준 에러 (stderr) 메시지
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
