| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 47824 | Talant | Library (JOI18_library) | C++17 | 359 ms | 308 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <vector>
#include <bits/stdc++.h>
#include "library.h"
#define pb push_back
using namespace std;
int u[1005];
void Solve(int N)
{
vector<int> M(N);
int cur = 0;
vector<int> res;
res.pb(1);
u[cur] = 1;
for (int i = 0; i < N; i ++) {
M[cur] = 1;
for (int j = 0; j < N; j ++) {
if (!u[j] && j != cur) {
M[j] = 1;
int o = Query(M);
if (o == 1) {
u[j] = 1;
M[cur] = 0;
res.pb(j + 1);
cur = j;
break;
}
M[j] = 0;
}
}
}
reverse(res.begin(),res.end());
M[cur] = 0;
cur = 0;
for (int i = 0; i < N; i ++) {
M[cur] = 1;
for (int j = 0; j < N; j ++) {
if (!u[j]) {
M[j] = 1;
int o = Query(M);
if (o == 1) {
u[j] = 1;
M[cur] = 0;
res.pb(j + 1);
cur = j;
break;
}
M[j] = 0;
}
}
}
Answer(res);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
