Submission #1044112

#TimeUsernameProblemLanguageResultExecution timeMemory
1044112vjudge1Zagonetka (COI18_zagonetka)C++17
9 / 100
3 ms344 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...