Submission #918170

# Submission time Handle Problem Language Result Execution time Memory
918170 2024-01-29T13:21:46 Z vjudge1 Carnival (CEOI14_carnival) C++17
0 / 100
13 ms 344 KB
#include <bits/stdc++.h>
#include <iostream>

using namespace std;

#define ll long long
#define pii pair<ll, ll>
#define oo 1e9

int n;

int main(){
    cin >> n;
    int ans[n + 1];
    vector<int> v;
    ans[1] = 1;
    int c = 1;
    for(int i = 2; i <= n; i++){
        int l = 1, r = i - 1;
        cout << i << ' ';
        for(int j = 1; j <= i; j++){
            cout << j << ' ';
        }
        cout << endl;
        int tmp; cin >> tmp;
        if(tmp != c){
            ans[i] = ++c;
            continue;
        }
        while(l < r){
            int mid = (l + r) / 2;
            cout << mid - l + 1 << ' ';
            for(int j = l; j <= mid; j++){
                cout << j << ' ';
            }
            cout << endl;
            int a; cin >> a;
            cout << mid - l + 2 << ' ';
            for(int j = l; j <= mid; j++){
                cout << j << ' ';
            }
            cout << i << ' ';
            cout << endl;
            int b; cin >> b;
            if(a == b){
                r = mid;
            }
            else{
                l = mid + 1;
            }
        }
        ans[i] = l;
    }
    cout << "0 ";
    for(int i = 1; i <= n; i++){
        cout << ans[i] << ' ';
    }
    cout << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 344 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 344 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 344 KB Output is correct
2 Incorrect 8 ms 344 KB Integer 11 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 344 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 344 KB Output is correct
2 Incorrect 9 ms 344 KB Integer 22 violates the range [1, 17]
3 Halted 0 ms 0 KB -