# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120395 | 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"
using namespace std;
void solve(int n) {
cin >> n;
vector <int> v, v2;
for(int i = 1; i <= n; i++) {
v.pb(i);
}
v2 = v;
reverse(v2.begin(), v2.end());
while(v != v2) {
cout << "publish({";
for(auto to : v) {
cout << to << ",";
}
cout << "})\n";
int res;
cin >> res;
if(res == 0) {
cout << "answer({";
for(auto to : v) {
cout << to << ",";
}
cout << "})";
return;
}
next_permutation(v.begin(), v.end());
}
cout << "publish({";
for(auto to : v) {
cout << to << ",";
}
cout << "})\n";
int res;
cin >> res;
if(res == 0) {
cout << "answer({";
for(auto to : v) {
cout << to << ",";
}
cout << "})";
return;
}
}