#include <bits/stdc++.h>
using namespace std;
signed main()
{
int n;
cin>>n;
int x;
for (int i=0;i<n;i++)
cin>>x;
if (n<=6)
{
vector<int> v;
for (int i=1;i<=n;i++)
v.push_back(i);
vector<int> ans,ans1;
do
{
cout<<"query";
for (int i:v)
cout<<' '<<i;
cout<<endl;
cin>>x;
if (x)
{
if (ans.empty())
ans=v;
ans1=v;
}
}while(next_permutation(v.begin(),v.end()));
cout<<"end"<<'\n';
for (int i=0;i<n-1;i++)
cout<<ans[i]<<' ';
cout<<ans.back()<<'\n';
for (int i=0;i<n-1;i++)
cout<<ans1[i]<<' ';
cout<<ans1.back()<<endl;
}
else
{
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
3 ms |
344 KB |
Output is correct |
6 |
Correct |
3 ms |
344 KB |
Output is correct |
7 |
Correct |
3 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Unexpected end of file - token expected |
2 |
Halted |
0 ms |
0 KB |
- |