Submission #918715

#TimeUsernameProblemLanguageResultExecution timeMemory
918715MoonnCarnival (CEOI14_carnival)C++17
100 / 100
12 ms596 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...