#include<bits/stdc++.h>
using namespace std;
long long n, a[1001], cur = 2, inp, color[1001];
int main()
{
cin >> n;
a[1] = 1;
color[1] = 1;
for(int i = 2; i <= n; ++i)
{
color[i] = 0;
cout.flush() << cur << " ";
for(int j = 1; j < cur; ++j)
{
cout.flush() << a[j] << " ";
}
cout.flush() << i << "\n";
cin >> inp;
if(inp == cur)
{
a[cur] = i;
color[i] = cur;
++cur;
}
}
for(int i = 1; i <= n; ++i)
{
if(!color[i])
{
long long r = cur, l = 1;
while(r > l)
{
long long mid = (l + r) / 2;
cout.flush() << mid - l + 2 << " ";
for(int j = l; j <= mid; ++j)
{
cout.flush() << a[j] << " ";
}
cout.flush() << i << "\n";
cin >> inp;
if(inp == mid - l + 1)
{
r = mid;
}
else
{
l = mid + 1;
}
}
color[i] = a[l];
}
}
cout.flush() << 0;
for(int i = 1; i <= n; ++i)
{
cout.flush() << " " << color[i];
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
208 KB |
Integer 19 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Integer 6 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
208 KB |
Output is correct |
2 |
Incorrect |
6 ms |
208 KB |
Integer 11 violates the range [1, 8] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Integer 5 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
208 KB |
Output is correct |
2 |
Incorrect |
9 ms |
208 KB |
Integer 22 violates the range [1, 17] |
3 |
Halted |
0 ms |
0 KB |
- |