Submission #749962

#TimeUsernameProblemLanguageResultExecution timeMemory
749962huutuanCarnival (CEOI14_carnival)C++14
100 / 100
8 ms256 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define sz(x) ((int)x.size()) #define sumof(x) accumulate(all(x), 0ll) const int N=151; int id[N], n, a[N]; int guess(int x, int y){ cout << x+1 << ' '; for (int i=1; i<=x; ++i) cout << id[i] << ' '; cout << y << endl; int z; cin >> z; return z; } void solve(int tc){ // cout << "Case #" << tc << ": "; cin >> n; vector<int> v; int cc=0; for (int i=1; i<=n; ++i){ int t=guess(cc, i); if (t>cc){ a[i]=++cc; id[cc]=i; }else{ int l=1, r=cc; while (l<=r){ int mid=(l+r)>>1ll; if (guess(mid, i)==mid) r=mid-1; else l=mid+1; } a[i]=l; } } cout << 0; for (int i=1; i<=n; ++i) cout << ' ' << a[i]; cout << endl; } int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int ntests=1; // cin >> ntests; for (int i=1; i<=ntests; ++i) solve(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...