#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
208 KB |
Output is correct |
2 |
Correct |
20 ms |
208 KB |
Output is correct |
3 |
Correct |
21 ms |
208 KB |
Output is correct |
4 |
Correct |
5 ms |
208 KB |
Output is correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
15 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Correct |
17 ms |
208 KB |
Output is correct |
3 |
Correct |
14 ms |
208 KB |
Output is correct |
4 |
Correct |
10 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
7 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Correct |
8 ms |
208 KB |
Output is correct |
3 |
Correct |
33 ms |
208 KB |
Output is correct |
4 |
Correct |
5 ms |
208 KB |
Output is correct |
5 |
Correct |
4 ms |
208 KB |
Output is correct |
6 |
Correct |
2 ms |
208 KB |
Output is correct |
7 |
Correct |
17 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Correct |
6 ms |
208 KB |
Output is correct |
3 |
Correct |
19 ms |
208 KB |
Output is correct |
4 |
Correct |
7 ms |
208 KB |
Output is correct |
5 |
Correct |
3 ms |
208 KB |
Output is correct |
6 |
Correct |
7 ms |
208 KB |
Output is correct |
7 |
Correct |
15 ms |
208 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Correct |
12 ms |
208 KB |
Output is correct |
3 |
Correct |
25 ms |
208 KB |
Output is correct |
4 |
Correct |
21 ms |
208 KB |
Output is correct |
5 |
Correct |
6 ms |
208 KB |
Output is correct |
6 |
Correct |
3 ms |
208 KB |
Output is correct |
7 |
Correct |
11 ms |
208 KB |
Output is correct |