Submission #995934

#TimeUsernameProblemLanguageResultExecution timeMemory
995934vjudge1Carnival (CEOI14_carnival)C++17
0 / 100
1 ms344 KiB
#include<bits/stdc++.h> #define int long long using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n,tmp=0; cin>>n; vector<int> v(n+1),res(n+1,0); for(int i=1;i<=n;i++){ cout<<i<<" "; for(int j=1;j<=i;j++) cout<<j<<" "; int x; cin>>x; if(x>tmp){ tmp++; v[tmp]=i; res[i]=tmp; } } for(int i=1;i<=n;i++){ if(res[i]==0){ int l=1,r=tmp; while(l<r){ int m=(l+r)/2; cout<<m+1<<" "; for(int j=1;j<=m;j++) cout<<v[j]<<" "; int x;cin>>x; if(x>m) r=m-1; else l=m; } res[i]=l; } } for(int i=1;i<=n;i++) cout<<res[i]<<" "; }
#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...