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;
int main()
{
int n;
cin >> n;
vector < int > c(n, 0);
vector < bool > b(n, true);
int friends = 1;
for (int i = 0; i < n; ++i) {
cout << friends << " ";
for (int j = 0; j <= i; ++j) {
if (b[j]) {
cout << j + 1 << " ";
}
}
cout << endl;
int costumes;
cin >> costumes;
if (costumes == friends) {
c[i] = costumes;
++friends;
} else {
int aux = friends;
for (int j = 0; j < i && !c[i]; ++j) {
if (b[j]) {
if (j == i - 1) {
c[i] = c[j];
continue;
}
--aux;
cout << aux << " ";
for (int k = j + 1; k <= i; ++k) {
if (b[k])
cout << k + 1 << " ";
}
cout << endl;
int ans;
cin >> ans;
if (ans == aux) {
c[i] = c[j];
}
}
}
b[i] = false;
}
}
cout << 0 << endl;
for (int i = 0; i < n; ++i) {
cout << c[i] << " ";
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |