이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
//#define endl '\n'
int n;
int it[101];
bool check(vector<int> aa){
cout<<"query ";
for(auto j:aa){
cout<<j<<" ";
}
cout<<endl;
int x;
cin>>x;
return x;
}
void answer(vector<int> aa,vector<int> bb){
cout<<"end"<<endl;
for(auto j:aa){
cout<<j<<" ";
}
cout<<endl;
for(auto j:bb){
cout<<j<<" ";
}
cout<<endl;
return;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n;
for(int i=0;i<n;i++){
cin>>it[i];
}
if(n<=6){
vector<int> ss;
for(int i=1;i<=n;i++){
ss.pb(i);
}
vector<int> ans;
vector<int> ans2;
while(true){
if(check(ss)){
if(ans.size()==0){
ans=ss;
}
ans2=ss;
}
if(next_permutation(ss.begin(),ss.end())){
continue;
}
else{
break;
}
}
answer(ans,ans2);
return 0;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |