# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
100768 | JPN20 | 도서관 (JOI18_library) | C++17 | 530 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "library.h"
using namespace std;
int c = 0, N; bool used[1009];
int getans(int pos) {
vector<int>vec;
for (int i = 0; i < N; i++) {
if (used[i] == false) vec.push_back(i);
}
int sz = 1, cc = 0; while (sz <= vec.size()) { sz *= 2; cc++; }
int cx = 0;
for (int i = cc - 1; i >= 0; i--) {
vector<int>V1(N, 0);
for (int j = 0; j < cx + (1 << i); j++) {
if (j >= vec.size()) break;
V1[vec[j]] = 1;
}
vector<int>V2 = V1; V2[c] = 1;
int F1 = Query(V1);
int F2 = Query(V2);
if (F1 != F2) cx += (1 << i);
}
return vec[cx];
}
void Solve(int NN) {
N = NN;
for (int i = 0; i < N; i++) {
vector<int>G(N, 1); G[i] = 0;
int Z = Query(G);
if (Z == 1) { c = i; }
}
vector<int>W;
used[c] = true; W.push_back(c + 1);
for (int i = 0; i < N - 1; i++) {
int f = getans(c);
W.push_back(f + 1);
used[f] = true;
c = f;
}
Answer(W);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |