# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
660121 | Karuk | 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>
#include "art.h"
using namespace std;
void solve(int n) {
long long num=0;
vector<int>d;
for(int i=1;i<=n;i++)d.push_back(i);
vector<int>ans(n);
vector<int>v;
for(int i=0;i<n;i++) {
v.push_back(publish(temp));
d.push_back(d[0]);
d.pop_front();
}
v.push_back(v[0]);
for(int i=1;i<=n;i++) {
int val=v[i]-v[i-1];
val-=n;
val*=-1;
val--;
val/=2;
ans[val]=i;
}
answer(ans);
}