# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596447 | daisy2 | Carnival (CEOI14_carnival) | C++14 | 11 ms | 216 KiB |
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<iostream>
using namespace std;
int n,m[300],num=0,a,l,r,mid,re[300];
int main()
{
cin>>n;
m[1]=1;num=1;re[1]=1;
for(int i=2;i<=n;i++)
{
cout<<num+1<<" "<<i<<" ";
for(int j=1;j<=num;j++)
cout<<m[j]<<" ";cout<<endl;
cin>>a;
if(a==num+1)
{
num++;m[num]=i;re[i]=num;
continue;
}
l=1;r=num;
while(l<=r)
{
mid=(l+r)/2;
cout<<mid+1<<" "<<i<<" ";
for(int j=1;j<=mid;j++)
cout<<m[j]<<" ";cout<<endl;
cin>>a;
if(a==mid+1) l=mid+1;
else r=mid-1;
}
re[i]=l;
}
cout<<0<<" ";
for(int i=1;i<=n;i++)
cout<<re[i]<<" ";
cout<<endl;
}
Compilation message (stderr)
# | 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... |