This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int ask(int l,int r){
cout<<r-l+1<<" ";
for(int i=l;i<=r;i++)cout<<i<<" ";
cout<<endl;
int p;cin>>p;
return p;
}
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int x;cin>>x;
map<int,int>mp;
vector<int>ans;
int lst=0;
for(int i=1;i<=x;i++){
int z=ask(1,i);
if(z>lst){
lst=z;mp[z]=i;
ans.push_back(z);
}else{
int m;
for(int j=1;j<=lst;j++){
cout<<"2 "<<mp[j]<<" "<<i<<endl;
int p;cin>>p;
if(p==1){m=j;break;}
}
ans.push_back(m);
}
}
cout<<"0 ";
for(auto i:ans)cout<<i<<" ";
cout<<endl;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |