# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1179009 | tamyte | Art Collections (BOI22_art) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5;
#include "art.h"
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
// res = vector<int>(n);
// iota(begin(res), end(res), 1);
// random_shuffle(begin(res), end(res));
// cout << "EXPECTED : ";
// for (auto& u : res) {
// cout << u << " ";
// }
// cout << endl;
// pos = vector<int>(n + 1);
// for (int i = 0; i < res.size(); ++i) {
// pos[res[i]] = i;
// }
vector<int> response(n);
for (int i = 0; i < n; ++i) {
vector<int> q;
for (int j = 0; j < n; ++j) {
q.push_back((i + j) % n + 1);
response[i] = publish(q);
}
// for (auto& u : q) {
// cout << u << " ";
// }
// cout << " = " << response[i] << "\n";
}
vector<int> ans(n);
for (int i = 0; i < n; ++i) {
int init_pos = (response[i] - response[(i + 1) % n] + n) / 2;
ans[init_pos] = i + 1;
}
answer(ans);
// for (auto& u : response) {
// cout << u << endl;
// }
}