# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1102692 | MateiKing80 | 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> inv(n + 1);
for(int i = 1; i <= n; i ++)
{
vector<int> v;
for(int j = i; j <= n; j ++)
v.push_back(j);
for(int j = 1; j <= i - 1; j ++)
v.push_back(j);
inv[i - 1] = publish(v);
}
vector<int> ans(n);
inv[n] = inv[0];
for(int i = 0; i < n; i ++)
ans[(inv[i] - inv[i + 1] + n - 1) / 2] = i + 1;
answer(ans);
}