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 ll long long
#define fi first
#define se second
const ll MOD=1e9+7;
using namespace std;
ll N,a[155];
map <ll,ll> mp;
int main(){
cin>>N;
ll prev=0;
for(int i=1;i<=N;i++){
cout<<i<<' ';
for(int j=1;j<=i;j++){
cout<<j<<' ';
}
cout<<endl;
ll x;
cin>>x;
if(x==prev+1){
a[i]=x;
mp[x]=i;
}
else{
ll l=1;
ll r=x;
ll ans=0;
while(l<=r){
ll m=(l+r)/2;
cout<<m-l+2<<' '<<i<<' ';
for(int j=l;j<=m;j++){
cout<<mp[j]<<' ';
}
cout<<endl;
ll temp;
cin>>temp;
if(temp==m-l+1){
ans=m;
r=m-1;
}
else{
l=m+1;
}
}
a[i]=ans;
}
prev=x;
}
cout<<0<<' ';
for(int i=1;i<=N;i++){
cout<<a[i]<<' ';
}
cout<<endl;
}
# | 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... |