# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
97634 | tincamatei | 동굴 (IOI13_cave) | C++14 | 637 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 5000;
vector<int> pos;
int combination[MAX_N];
int S[MAX_N], D[MAX_N];
void exploreCave(int N) {
for(int i = 0; i < N; ++i)
pos.push_back(i);
for(int i = 0; i < N; ++i) {
for(auto it: pos)
combination[it] = 1;
int rez = tryCombination(combination);
bool correctState = false;
if(rez == -1 || rez > i)
correctState = true;
int st = -1, dr = pos.size() - 1;
while(dr - st > 1) {
int mid = (st + dr) / 2;
for(int i = 0; i <= mid; ++i)
combination[pos[i]] = correctState;
for(int i = mid + 1; i < pos.size(); ++i)
combination[pos[i]] = 1 - correctState;
int rez = tryCombination(combination);
if(rez == -1 || rez > i)
dr = mid;
else
st = mid;
}
D[pos[dr]] = i;
S[pos[dr]] = correctState;
combination[pos[dr]] = correctState;
pos.erase(pos.begin() + dr);
}
answer(S, D);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |