Submission #996192

#TimeUsernameProblemLanguageResultExecution timeMemory
996192vjudge1Carnival (CEOI14_carnival)C++17
100 / 100
14 ms2508 KiB
#include <bits/stdc++.h> #include<unordered_map> #define pll pair<ll, ll> #define ll long long #define int long long #define pb push_back #define ff first #define ss second #define ins insert #define pll2 pair<pair<ll,ll>,ll> #define bit(i,k) (k>>i)&1 using namespace std; const long long mod = 1e9 + 7; const ll maxN = 3e6; const ll inf = 1e18; ll pre[maxN]; ll type[maxN]; void solve() { ll n; cin >> n; for (int i = 1; i <= n; i++) { cout << i; for (int j = 1; j <= i; j++) { cout << " " << j; } cout << endl; cin >> pre[i]; } ll cur = 0; for (int i = 1; i <= n; i++) { ll l = 0, r = i-1; ll mx = 0; while (l <= r) { ll md = (l + r) / 2; cout << md +1 << " "; for (int j = 1; j <= md; j++) { cout << j << " "; } cout << i; cout << endl; ll x; cin >> x; if (pre[md] + 1 == x) { l = md + 1; mx = max(mx, md); } else { r = md - 1; } } if (mx+1 == i) { cur++; type[i] = cur; } else { type[i] = type[mx+1]; } } cout << 0 << " "; for (int i = 1; i <= n; i++) { cout << type[i] << " "; } cout << endl; } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // freopen("09.inp", "r", stdin); // freopen("09.out", "w", stdout); ll nhim = 1; //cin >> nhim; while (nhim--) { solve(); } }
#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...