Submission #750012

# Submission time Handle Problem Language Result Execution time Memory
750012 2023-05-29T04:12:00 Z vjudge1 Carnival (CEOI14_carnival) C++11
0 / 100
7 ms 208 KB
#include <bits/stdc++.h>

using namespace std;

const int N = 153;
vector <int> v;
int n, co[N], resp;
int cnt = 1, l, r;

void proc(int w){
    l = 0, r = v.size()-1;
    while(l < r){
        int mid = (l+r)/2;
        cout << (mid-l+2) << ' ';
        for (int i = l; i <= mid; i++){
            cout << v[i] << ' ';
        }
        cout << w << endl;
        cin >> resp;
        if (resp == (mid-l+2)){
            r = mid;
        } else {
            l = mid+1;
        }
    }
    co[w] = co[l];
}

int main(){
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL); cout.tie(NULL);
    cin >> n;
    for (int i = 1; i <= n; i++){
        cout << i << ' ';
        for (int j = 1; j <= i; j++){
            cout << j << ' ';
        }
        cout << endl;
        cin >> resp;
        if (resp == (int)v.size() + 1){
            co[i] = cnt;
            cnt++;
            v.push_back(i);
        } else {
            proc(i);
        }
    }
    cout << 0 << ' ';
    for (int i = 1; i <= n; i++){
        cout << co[i] << ' ';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 208 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 208 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 208 KB Integer 0 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 208 KB Integer 0 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Integer 0 violates the range [1, 2]
2 Halted 0 ms 0 KB -