Submission #533482

#TimeUsernameProblemLanguageResultExecution timeMemory
533482kebineCarnival (CEOI14_carnival)C++17
100 / 100
10 ms328 KiB
#include <bits/stdc++.h> #define ll long long #define fi first #define se second const ll MOD=1e9+7; using namespace std; ll N,a[155]; map <ll,ll> mp; int main(){ cin>>N; ll prev=0; for(int i=1;i<=N;i++){ cout<<i<<' '; for(int j=1;j<=i;j++){ cout<<j<<' '; } cout<<endl; ll x; cin>>x; if(x==prev+1){ a[i]=x; mp[x]=i; } else{ ll l=1; ll r=x; ll ans=0; while(l<=r){ ll m=(l+r)/2; cout<<m-l+2<<' '<<i<<' '; for(int j=l;j<=m;j++){ cout<<mp[j]<<' '; } cout<<endl; ll temp; cin>>temp; if(temp==m-l+1){ ans=m; r=m-1; } else{ l=m+1; } } a[i]=ans; } prev=x; } cout<<0<<' '; for(int i=1;i<=N;i++){ cout<<a[i]<<' '; } cout<<endl; }
#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...