# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
538495 | safaricola | 도서관 (JOI18_library) | C++17 | 259 ms | 304 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <vector>
using namespace std;
#include<bits/stdc++.h>
#include "library.h"
deque<int> ans;
void Solve(int N){
vector<int> M(N);
ans.push_back(0);
M[0] = 1;
for(int j=1; j<N; j++){
for(int i=0; i<N; i++){
if(M[i]!=1){
M[i]=1;
//for(int i=0; i<N; i++)cout<<M[i];
// cout<<endl;
if(Query(M)==1){
//cout<<"FOUND\n";
M[ans[0]]=0;
if(Query(M)==1){
M[ans[0]]=1;
ans.push_back(i);
}else{
M[ans[0]]=1;
ans.push_front(i);
}
i=N;
//for(auto it: ans) cout<<it<<" ";
// cout<<endl;
}else{
M[i]=0;
}
}
}
}
assert(ans.size()==N);
vector<int> res(N);
for(int i = 0; i < N; i++) {
res[i] = ans[i] + 1;
}
Answer(res);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |