# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
896425 | 3laa | 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.
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
#include <unordered_map>
#define endl '\n'
#define mid ((l+r)/2)
#define F first
#define S second
#define pb push_back
#define yes void (cout<<"YES"<<endl)
#define no void (cout<<"NO"<<endl)
#define ump unordered_map <ll,ll>
#define sp " "
#define vll vector<ll>
#define vint vector<int>
#define pll pair<ll,ll>
typedef long long ll;
using namespace std;
const ll inf=1e18+9;
const int N=2e5+9;
const ll M=1e9+7;
int n,m;
int publish(vint v){
for(auto u : v)
cout<<u<<sp;
cout<<endl;
int ret;
cin>>ret;
return ret;
}
void answer(vint v){
for(auto u : v){
cout<<u<<sp;
}
cout<<endl;
}
void solve(ll n){
vint v;
for(int i=1; i<=n ; i++){
v.pb(i);
}
int ans=publish(v);
for(int i=1 ; i<=n ; i++){
for(int j=1 ; j<=n ; j++){
if(i==j) continue;
swap(v[i],v[j]);
int x=publish(v);
if(x<ans){
ans=x;
break;
}
else
swap(v[i],v[j]);
}
if(ans==0)
break;
}
answer(v);
}
int main(){
int tt=1;
//cin>>tt;
while(tt--){
cin>>n;
solve(n);
}
}