# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
644541 | Tudy006 | 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>
using namespace std;
vector <int> p;
vector <int> ans;
//int publish( vector <int> p ) {
// int x;
// for ( auto it : p ) cout << it << ' ';
// cout << endl;
// cin >> x;
// return x;
//
//}
//void answer( vector <int> p ) {
// cout << "The answer is: ";
// for ( auto it : p ) cout << it << ' ';
//}
void solve( int n ) {
for ( int i = 1; i <= n; i ++ ) p.push_back( i );
int x = publish( p ), a = x, b;
for ( int i = 2; i <= n; i ++ ) {
int aux = p[0];
for ( int i = 0; i + 1 < n; i ++ ) p[i] = p[i + 1];
p[n - 1] = aux;
b = publish( p );
ans.push_back( ( n - 1 + a - b ) / 2 + 1 );
a = b;
}
ans.push_back( ( n - 1 + x - a ) / 2 + 1 );
answer( ans );
}