Submission #987209

# Submission time Handle Problem Language Result Execution time Memory
987209 2024-05-22T10:49:05 Z VMaksimoski008 Carnival (CEOI14_carnival) C++17
0 / 100
12 ms 692 KB
#include <bits/stdc++.h>
using namespace std;

int ask(vector<int> v) {
    cout << v.size() << " ";
    for(int &x : v) cout << x << " ";
    cout << endl;

    int x;
    cin >> x;
    return x;
}

int find(int n) {
    vector<int> ans(n+1);

    ans[1] = 1;
    int cnt = 1;

    vector<int> v = { 1 };
    for(int i=2; i<=n; i++) {
        v.push_back(i);
        int X = ask(v);

        if(X > cnt) {
            ans[i] = ++cnt;
            continue;
        }

        vector<int> v2;
        for(int j=1; j<i; j++) {
            v2.push_back(j);
            if(ask(v2) == X) {
                ans[i] = ans[j];
                break;
            }
        }
    }

    for(int &x : ans) cout << x << " ";
    cout << endl;
    return 0;
}

int main() {
    int n;
    cin >> n;
    find(n);
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 684 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 692 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 688 KB Output is correct
2 Incorrect 9 ms 440 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 688 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 688 KB Incorrect
2 Halted 0 ms 0 KB -