#include <bits/stdc++.h>
using namespace std;
int n;
int ind[151];
int color[151];
int query(int m,int x)
{
cout << m+1 <<' ';
for(int i=1;i<=m;i++)
{
cout << ind[i]+1 <<' ';
}
cout << x+1 << endl;
int rez;
cin >> rez;
return rez;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
int colors=1;
for(int i=1;i<n;i++)
{
if(query(colors,i)==colors+1)
{
ind[colors]=i;
color[i]=colors;
colors++;
}
else
{
int l=0;
int r=colors-1;
int m;
while(l<r)
{
m=(l+r)/2;
if(query(m,i)==m+1)
{
l=m+1;
}
else
{
r=m;
}
}
color[i]=l;
}
}
cout << 0;
for(int i=1;i<=n;i++)
{
cout << ' ' <<color[i]+1;
}
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Incorrect |
7 ms |
384 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |