# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120355 | 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 <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>
using namespace std;
#define int long long
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define UseOFF ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0);
#define sz size
#define ins insert
#define new junkedseduneon
#define prev usfdjik
const ll N = 2e6 + 111;
void solve() {
ll n;
cin >> n;
vector <ll> 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";
ll 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";
ll res;
cin >> res;
if(res == 0) {
cout << "answer({";
for(auto to : v) {
cout << to << ",";
}
cout << "})";
return;
}
}
signed main()
{
UseOFF
ll ttt = 1;
//cin >> ttt;
while(ttt--)
{
solve();
}
}