# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596446 | Summers | Carnival (CEOI14_carnival) | C++14 | 1 ms | 208 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<bits/stdc++.h>
#pragma GCC optimize ("O3")
#define endl '\n'
using namespace std;
long long a[10000], r[1000];
int main()
{
//ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long i,j,n,le,ri,mid,num=1,ans;
cin>>n;
a[1]=1;r[1]=1;
for(i=2;i<=n;i++)
{
cout<<num+1;
for(j=1;j<=num;j++)cout<<" "<<a[j];
cout<<" "<<i<<endl;
cin>>ans;
if(ans>num){num++;a[num]=i;r[i]=num;continue;}
le=1; ri=num;
while(le<=ri)
{
mid=(le+ri)/2;
cout<<mid-le+2;
for(j=le;j<=mid;j++)cout<<" "<<a[j];
cout<<" "<<i;
cout<<endl;
cin>>ans;
if(ans==(mid-le+1))ri=mid-1;
else le=mid+1;
}
r[i]=le;
}
cout<<0;
for(i=1;i<=n;i++)cout<<" "<<r[i];cout<<endl;
return 0;
}
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... |