# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1046502 | vjudge1 | 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 "art.h"
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define int long long
#define ld long double
void solve(int n) {
vector<int> v;
for(int i = 1;i<=n;i++)v.push_back(i);
int ans[n+1];
for(int i = 0;i<n;i++){
ans[i] = publish(v);
v.push_back(v[0]);
v.erase(v.begin());
}
ans[n] = ans[0];
for(int i = 0;i<n;i++){
int x = ans[i] - (ans[i] + ans[i+1] - n + 1) / 2;
v[x] = i + 1;
}
answer(v);
}