# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1264950 | mingga | Art Collections (BOI22_art) | C++20 | 0 ms | 0 KiB |
// Author: caption_mingle
#include "bits/stdc++.h"
// #include "art.h"
using namespace std;
#define ln "\n"
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define ll long long
const int mod = 1e9 + 7;
const int inf = 2e9;
void solve(int N) {
vector<int> vec;
for(int i = 1; i <= N; i++) vec.pb(i);
vector<int> f(N, 0);
for(int i = 0; i < N; i++) {
f[i] = publish(vec);
for(int j = 0; j < N - 1; j++) {
swap(vec[j], vec[j + 1]);
}
}
vector<int> ans(N);
for(int i = 0; i < N; i++) {
int j = (i + 1) % N;
ans[(f[j] - f[i] + N - 1) / 2 + 1] = i + 1;
}
answer(ans);
}