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;
using namespace std;
int main()
{
int n,mx=0,l,r,a,b,i,j,vl,mid;
cin>>n;
vector<int>v;
vector<int>ans(n+1);
for(i=1;i<=n;i++)
{
cout<<i<<' ';
for(j=1;j<=i;j++)
cout<<j<<' ';
cout<<endl;
cin>>vl;
if(vl>mx)
{
mx=vl;
ans[i]=mx;
}
else
{
l=1;
r=i-1;
while(l<=r)
{
mid=(l+r)/2;
cout<<mid<<' ';
for(j=1;j<=mid;j++)
{
cout<<j<<' ';
}
cout<<endl;
cin>>a;
cout<<mid+1<<' ';
for(j=1;j<=mid;j++)
{
cout<<j<<' ';
}
cout<<i;
cout<<endl;
cin>>b;
if(a==b)
r=mid-1;
else
l=mid+1;
}
ans[i]=ans[l];
}
}
cout<<0<<" ";
for(int i=1;i<=n;i++)
{
cout<<ans[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... |