# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
59390 | spencercompton | 동굴 (IOI13_cave) | C++17 | 771 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cave.h"
#include <bits/stdc++.h>
using namespace std;
void exploreCave(int N) {
/* ... */
//tryCombination(int s);
//answer(int s, int d)
vector<int> rem;
int n = N;
int s[n];
int d[n];
for(int i = 0; i<n; i++){
s[i] = 0;
d[i] = -1;
rem.push_back(i);
}
for(int i = 0; i<n; i++){
int open = tryCombination(s);
if(open==-1 || open>i){
for(int j = 0; j<rem.size(); j++){
s[rem[j]] = 1-s[rem[j]];
}
}
//right now it is closed
int low = 0;
int high = rem.size()-1;
while(low<high){
int mid = (low+high)/2;
int t[n];
for(int j = 0; j<n; j++){
t[j] = s[j];
}
for(int j = 0; j<=mid; j++){
t[rem[j]] = 1-t[rem[j]];
}
open = tryCombination(t);
if(open==-1 || open>i){
high = mid;
}
else{
low = mid+1;
}
}
d[rem[low]] = i;
s[rem[low]] = 1-s[rem[low]];
vector<int> temp;
for(int j = 0; j<rem.size(); j++){
if(j==low){
continue;
}
temp.push_back(rem[j]);
}
rem = temp;
}
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... |