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>
#define int long long
using namespace std;
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n,tmp=0;
cin>>n;
vector<int> v(n+1),res(n+1,0);
for(int i=1;i<=n;i++){
cout<<i<<" ";
for(int j=1;j<=i;j++) cout<<j<<" ";
int x;
cin>>x;
if(x>tmp){
tmp++;
v[tmp]=i;
res[i]=tmp;
}
}
for(int i=1;i<=n;i++){
if(res[i]==0){
int l=1,r=tmp;
while(l<r){
int m=(l+r)/2;
cout<<m+1<<" ";
for(int j=1;j<=m;j++) cout<<v[j]<<" ";
int x;cin>>x;
if(x>m) r=m-1;
else l=m;
}
res[i]=l;
}
}
for(int i=1;i<=n;i++) cout<<res[i]<<" ";
}
# | 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... |