# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
396448 | Pichon5 | Carnival (CEOI14_carnival) | C++17 | 3 ms | 200 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>
#include <bits/stdc++.h>
#define vi vector<int>
#define pb push_back
using namespace std;
int main()
{
int n;
cin>>n;
vi color(n+1,0);
color[1]=1;
vi v;
v.pb(1);
for(int i=2;i<=n;i++){
cout<<v.size()+1<<" "<<i<<" ";
for(int l=0;l<v.size();l++){
cout<<v[l]<<" ";
}
cout<<endl;
int F;
cin>>F;
if(F>n){
color[i]=F;
v.pb(i);
}
}
for(int i=1;i<=n;i++){
if(color[i])continue;
int b=0,e=v.size()-1;
while(b<=e){
int mid=(b+e)/2;
if(b==e){color[i]=color[v[b]];break;}
cout<<mid-b+2<<" ";
int n=mid-b+1;
cout<<i<<" ";
for(int l=b;l<=mid;l++){
cout<<v[l]<<" ";
}
cout<<endl;
int F;
cin>>F;
if(F==n){
e=mid;
}else{
b=mid;
if(b+1==e){
color[i]=color[v[e]];
break;
}
}
}
}
cout<<0<<" ";
for(int i=1;i<=n;i++){
cout<<color[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... |