# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
544189 | krit3379 | Carnival (CEOI14_carnival) | C++14 | 9 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>
using namespace std;
#define N 155
int type[N],head[N],ans[N];
int main(){
int n,i,j,l,r,mid,x;
scanf("%d",&n);
for(i=1;i<=n;i++){
printf("%d ",i);
for(j=1;j<=i;j++)printf("%d ",j);
printf("\n");
fflush(stdout);
scanf("%d",&type[i]);
if(type[i]!=type[i-1])head[type[i]]=i;
}
for(i=1;i<=n;i++){
if(head[type[i]]==i){
ans[i]=type[i];
continue;
}
l=1,r=type[i];
while(l<r){
mid=(l+r)/2;
printf("%d ",mid-l+2);
for(j=l;j<=mid;j++)printf("%d ",head[j]);
printf("%d \n",i);
fflush(stdout);
scanf("%d",&x);
if(x!=mid-l+1)l=mid+1;
else r=mid;
}
ans[i]=l;
}
printf("0 ");
for(i=1;i<=n;i++)printf("%d ",ans[i]);
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... |