Submission #554265

#TimeUsernameProblemLanguageResultExecution timeMemory
554265GurbanCarnival (CEOI14_carnival)C++17
100 / 100
19 ms324 KiB
#include "bits/stdc++.h" using namespace std; using ll = long long; const int maxn=200; int n; int a[maxn]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin >> n; a[1] = 1; int now = 1; for(int i = 2;i <= n;i++){ int l = 1,r = i - 1,md,jog=-1; while(l <= r){ md = (l + r) >> 1; set<int>s; vector<int>quer; for(int j = md;j < i;j++){ s.insert(a[j]); quer.push_back(j); } quer.push_back(i); cout<<(int)quer.size()<<' '; for(auto i : quer) cout<<i<<' '; cout<<endl; int jg; cin >> jg; if(jg > (int)s.size()) r = md - 1; else jog = a[md],l=md+1; } if(jog == -1) a[i] = ++now; else a[i] = jog; } cout<<"0 "; for(int i = 1;i <= n;i++) cout<<a[i]<<' '; 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...