# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
421321 | errorgorn | Cave (IOI13_cave) | C++17 | 281 ms | 580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <cstdio>
#include <vector>
using namespace std;
int n;
int door[5005];
int button[5005];
int temp[5005];
vector<int> left;
void test(int i){
if (tryCombination(button)!=i){
for (int x=0;x<left.size();x++) button[left[x]]^=1;
}
int l=0,r=left.size()-1,m;
while (l!=r){
m=(l+r)>>1;
for (int x=0;x<n;x++){
temp[x]=button[x];
}
for (int x=l;x<=m;x++){
temp[left[x]]^=1;
}
if (tryCombination(temp)==i){
l=m+1;
}
else{
r=m;
}
}
door[left[l]]=i;
button[left[l]]^=1;
left.erase(left.begin()+l);
}
void exploreCave(int N) {
n=N;
for (int x=0;x<n;x++){
door[x]=x;
left.push_back(x);
}
for (int x=0;x<n;x++){
test(x);
}
answer(button,door);
}
컴파일 시 표준 에러 (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... |