# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120949 | 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<bits/stdc++.h>
#include "art.h"
bool used[1111][1111];
using namespace std;
void solve(int n) {
vector <int> v, v2;
for(int i = 1; i <= n; i++) {
v.push_back(n - i + 1);
}
int res = publish(v);
if(res == 0) {
answer(v);
return;
}
set <pair <int, int> > st;
for(int j = 1; j < n; j++) {
swap(v[0], v[j]);
int x = publish(v);
st.insert({x, v[j]});
swap(v[0], v[j]);
}
vector <int> ans;
for(auto to : st) {
ans.pb(to.ss);
}
answer(ans);
}