# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
723458 | Charizard2021 | Art Collections (BOI22_art) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
vector<int> responses;
for(int i = 0; i < n; ++i) {
vector<int> order(n);
for(int j = 0; j < n; ++j)
order[j] = (j + i) % n + 1;
responses.push_back(publish(order));
}
vector<int> final_order(n);
for(int i = 0; i < n; ++i) {
final_order[(responses[i]-responses[(i + 1) % n] + n - 1) / 2] = i + 1;
}
answer(final_order);
}