# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
573629 | pavement | Art Collections (BOI22_art) | C++17 | 1716 ms | 580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
void solve(int N) {
int _ord[2 * N + 1], *ord = _ord + N;
memset(_ord, -1, sizeof _ord);
ord[0] = 1;
vector<int> order, out;
for (int i = 1; i <= N; i++) order.pb(i);
int E = publish(order);
for (int i = 2, pos = 0; i <= N; i++) {
int tmp = -1;
if (i & 1) {
swap(order[pos], order[(i - 1) / 2]);
tmp = order[pos];
pos = (i - 1) / 2;
} else {
swap(order[pos], order[order.size() - i / 2]);
tmp = order[pos];
pos = order.size() - i / 2;
}
int E2 = publish(order), D = E2 - E;
if (i & 1) D = -D;
int dist = (D > 0 ? (D + 1) / 2 : -(-D + 1) / 2);
if (dist > 0) {
int pos = 0;
while (dist) {
if (ord[pos] == -1) dist--;
pos++;
}
ord[pos - 1] = tmp;
} else {
int pos = 0;
while (dist) {
if (ord[pos] == -1) dist++;
pos--;
}
ord[pos + 1] = tmp;
}
E = E2;
}
for (int i = -N; i <= N; i++)
if (ord[i] != -1) out.pb(ord[i]);
answer(out);
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |