#include <bits/stdc++.h>
using namespace std;
int n,p[151],x,k;
vector <int> u;
int main()
{ cin>>n;
p[1]=++k;
u.push_back(1);
for(int i=2;i<=n;i++)
{ cout<<i<<" ";
for(int j=1;j<=i;j++)
cout<<j<<" ";
cout<<'\n';
int c;
cin>>c;
if(x!=c)
p[i]=++k,u.push_back(i);
x=c;
}
for(int i=1;i<=n;i++)
{ if(p[i])
continue;
int st=0,dr=u.size()-1,r=0;
while(st<=dr)
{ int m=(st+dr)/2;
cout<<m-st+2<<" ";
for(int j=st;j<=m;j++)
cout<<u[j]<<" ";
cout<<i<<'\n';
cin>>x;
if(x==m-st+1)
dr=m-1,r=m;
else
st=m+1;
}
p[i]=p[u[r]];
}
cout<<"0 ";
for(int i=1;i<=n;i++)
cout<<p[i]<<" ";
cout<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
384 KB |
Output is correct |
2 |
Correct |
11 ms |
384 KB |
Output is correct |
3 |
Correct |
10 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Incorrect |
11 ms |
256 KB |
Integer 4 violates the range [1, 3] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
384 KB |
Output is correct |
2 |
Correct |
12 ms |
256 KB |
Output is correct |
3 |
Correct |
8 ms |
384 KB |
Output is correct |
4 |
Correct |
7 ms |
384 KB |
Output is correct |
5 |
Correct |
12 ms |
384 KB |
Output is correct |
6 |
Incorrect |
12 ms |
256 KB |
Integer 16 violates the range [1, 15] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
256 KB |
Integer 2 violates the range [1, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
384 KB |
Output is correct |
2 |
Correct |
11 ms |
256 KB |
Output is correct |
3 |
Correct |
9 ms |
256 KB |
Output is correct |
4 |
Correct |
6 ms |
376 KB |
Output is correct |
5 |
Correct |
13 ms |
384 KB |
Output is correct |
6 |
Correct |
12 ms |
384 KB |
Output is correct |
7 |
Correct |
13 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
256 KB |
Output is correct |
2 |
Correct |
12 ms |
256 KB |
Output is correct |
3 |
Correct |
11 ms |
256 KB |
Output is correct |
4 |
Correct |
10 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
256 KB |
Output is correct |
6 |
Correct |
8 ms |
256 KB |
Output is correct |
7 |
Correct |
8 ms |
384 KB |
Output is correct |