Submission #996162

# Submission time Handle Problem Language Result Execution time Memory
996162 2024-06-10T08:22:49 Z vjudge1 Carnival (CEOI14_carnival) C++17
0 / 100
2 ms 2392 KB
#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 = 1, r = i;
        ll mx = inf;
        while (l <= r) {
            ll md = (l + r) / 2;
            cout << md + 1 << " ";
            for (int j = 1; j <= md; j++) {
                cout << j << " ";
            }
            if (md != i)
                cout << i;
            cout << endl;
            ll x;
            cin >> x;
            if (pre[md] + 1 == x) {
                l = md + 1;
            }
            else {
                r = md - 1;
                mx = min(mx, md);
            }
        }
        if (mx == i) {
            cur++;
            type[i] = cur;
        }
        else {
            type[i] = type[mx];
        }

    }
    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 time Memory Grader output
1 Execution timed out 2 ms 2392 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2 ms 2392 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2 ms 2392 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2 ms 2392 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2 ms 2392 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -