# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007480 | kukuk | 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;
vector<int> dq;
vector<pair<int,int>> v;
vector<int> ans;
void solve(int N){
for(int i = 1; i <= N; i++){
dq.push_back(i);
}
int cyc[2010];
int l = 2;
for(int i = 0; i < N; i++){
int val = publish(dq);
cyc[i] = val;
dq.clear();
for(int j = l; j <= N; j++){
dq.push_back(j);
}
for(int j = 1; j <= l; j++){
dq.push_back(j);
}
l++;
}
cyc[N] = cyc[0];
for(int i = 0; i < N; i++){
v.push_back({cyc[i+1]-cyc[i], i});
}
sort(v.begin(), v.end());
for(int i = 0; i < N; i++){
ans.push_back(v[i].second);
}
answer(ans);
}