# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
289922 | Atill83 | 동굴 (IOI13_cave) | C++14 | 318 ms | 760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int) 5e3 + 5;
int s[MAXN];
int ans[MAXN];
vector<int> rest;
int D[MAXN];
void ot(int N){
for(int i = 0; i < N; i++) cerr<<s[i]<<" ";
cerr<<endl;
}
void exploreCave(int N) {
/* ... */
for(int i = 0; i < N; i++) rest.push_back(i);
for(int i = 0; i < N; i++){
bool st = 1;
for(int j = 0; j < rest.size(); j++){
s[rest[j]] = 0;
}
int ans = tryCombination(s);
if(ans == -1 || ans > i){
st = 0;
}
int l = 0, r = rest.size() - 1;
while(l < r){
int m = (l + r) / 2;
for(int j = l; j <= m; j++){
s[rest[j]] = st;
}
for(int j = m + 1; j <= r; j++)
s[rest[j]] = !st;
//cerr<<l<<" "<<r<<endl;
//ot(N);
int ans = tryCombination(s);
if(ans == -1 || ans > i){
r = m;
}else{
l = m + 1;
}
}
//cerr<<st<<endl;
//cerr<<rest[l]<<" "<<i<<endl;
//ot(N);
s[rest[l]] = st;
D[rest[l]] = i;
swap(rest[l], rest.back());
rest.pop_back();
}
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... |