# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1157977 | the_ZHER | Art Collections (BOI22_art) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "art.h"
using namespace std;
void solve(int N){
vector<int>ans;
for(int i=1;i<=N;i++){
ans.push_back(i);
}
int cnt=publish(ans);
auto cmp=[&](int x,int y) -> bool{
vector<int>v;
for(int i=1;i<=N;i++){
v.push_back(i);
}
swap(v[x-1],v[y-1]);
int cnt1=publish(v);
if(x<y){
return cnt<cnt1;
}else{
return cnt>cnt1;
}
}
stable_sort (ans.begin(),ans.end(),cmp);
answer(ans);
}