#include <iostream>
#include <set>
#include <map>
#include <vector>
using namespace std;
int main()
{
int n;
cin>>n;
map<int,int> val;
set<int> head;
for(int i=1;i<=n;i++)
{
val[i]=i;
}
head.insert(1);
int cppq;
for(int i=2;i<=n;i++)
{
cout<<((int)head.size())+1;
for(auto j:head)
{
cout<<' '<<j;
}
cout<<' '<<i<<endl;
cin>>cppq;
if(cppq==(int)head.size())
{
for(auto j:head)
{
cout<<2<<' '<<j<<' '<<i<<endl;
cin>>cppq;
if(cppq==1)
{
val[i]=val[j];
break;
}
}
}
else
{
head.insert(i);
}
}
cout<<0;
for(int i=1;i<=n;i++)
{
cout<<' '<<val[i];
}
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Integer 19 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
208 KB |
Integer 6 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Incorrect |
5 ms |
208 KB |
Integer 11 violates the range [1, 8] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
208 KB |
Integer 5 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
208 KB |
Output is correct |
2 |
Incorrect |
8 ms |
208 KB |
Integer 20 violates the range [1, 17] |
3 |
Halted |
0 ms |
0 KB |
- |