Submission #793035

# Submission time Handle Problem Language Result Execution time Memory
793035 2023-07-25T12:55:17 Z vjudge1 Carnival (CEOI14_carnival) C++14
100 / 100
7 ms 292 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){
        //cout << l << ' ' << r << " ENDPOINTS" << endl;
        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+1)){
            r = mid;
        } else {
            l = mid+1;
        }
    }
    co[w] = co[v[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 Correct 3 ms 288 KB Output is correct
2 Correct 6 ms 208 KB Output is correct
3 Correct 4 ms 208 KB Output is correct
4 Correct 2 ms 208 KB Output is correct
5 Correct 4 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 6 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 7 ms 208 KB Output is correct
3 Correct 4 ms 208 KB Output is correct
4 Correct 3 ms 292 KB Output is correct
5 Correct 6 ms 208 KB Output is correct
6 Correct 6 ms 208 KB Output is correct
7 Correct 6 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Correct 4 ms 208 KB Output is correct
3 Correct 7 ms 208 KB Output is correct
4 Correct 3 ms 208 KB Output is correct
5 Correct 6 ms 208 KB Output is correct
6 Correct 4 ms 208 KB Output is correct
7 Correct 7 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 208 KB Output is correct
2 Correct 5 ms 208 KB Output is correct
3 Correct 3 ms 208 KB Output is correct
4 Correct 3 ms 208 KB Output is correct
5 Correct 5 ms 208 KB Output is correct
6 Correct 5 ms 208 KB Output is correct
7 Correct 5 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Correct 7 ms 208 KB Output is correct
3 Correct 5 ms 208 KB Output is correct
4 Correct 5 ms 208 KB Output is correct
5 Correct 6 ms 208 KB Output is correct
6 Correct 3 ms 208 KB Output is correct
7 Correct 3 ms 208 KB Output is correct