# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1113757 | vladilius | 동굴 (IOI13_cave) | C++17 | 254 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "cave.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
void exploreCave(int n){
int b[n], p[n], s[n];
vector<int> ch;
for (int i = 0; i < n; i++) ch.pb(i);
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++) s[j] = 0;
for (int j = 0; j < i; j++){
s[p[j]] = b[j];
}
int f = tryCombination(s), d = (f == i);
b[i] = d;
int l = 0, r = (int) ch.size() - 1;
auto check = [&](int m){
for (int j = 0; j <= m; j++){
s[ch[j]] = d;
}
for (int j = m + 1; j < ch.size(); j++){
s[ch[j]] = !d;
}
int f = tryCombination(s);
return (f != i);
};
while (l + 1 < r){
int m = (l + r) / 2;
if (check(m)){
r = m;
}
else {
l = m + 1;
}
}
if (check(l)) r = l;
p[i] = ch[r];
ch.erase(ch.begin() + r);
}
int x[n], y[n];
for (int i = 0; i < n; i++){
x[p[i]] = i;
y[p[i]] = b[i];
}
answer(y, x);
}
컴파일 시 표준 에러 (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... |