| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368084 | nataliaa | Art Collections (BOI22_art) | C++20 | 0 ms | 0 KiB |
// #include "art.h"
#include<bits/stdc++.h>
using namespace std;
void solve(int n) {
vector<int> v;
for(int i = 1;i<=n; i++) v.push_back(i);
pair<int, int> p[n];
for(int i = 0; i < n; i++){
int k = publish(v);
p[v[0]-1].first = k;
p[v[n-1]-1].second = k;
int l = v[0];
for(int j = 0; j < n-1; j++) v[j] = v[j+1];
v[n-1]=l;
}
vector<int> ans(n);
for(int i = 0; i < n; i++){
int x = p[i].first;
int y = p[i].second;
int z = y - x;
y = n - 1 - z;
z = y/2;
ans[z] = i+1;
}
answer(ans);
}