Submission #918366

# Submission time Handle Problem Language Result Execution time Memory
918366 2024-01-29T17:43:10 Z Ferid20072020 Carnival (CEOI14_carnival) C++14
0 / 100
4 ms 444 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

int n , ans;
vector<int> save(155);

signed main(){
    cin >> n;

    cout << "1 1";
    cout << endl;
    cin >> ans;
    save[1] = ans;

    vector<int> arr(n+5);
    arr[1] = 1;
    int color = 2;

    for(int i=2 ; i<=n ; i++){
        cout << i << " ";
        for(int j=1 ; j<=i ; j++){
            cout << j << " ";
        }
        cout << endl;
        cin >> ans;
        if(ans > save[i-1]){
            save[i] = ans;
            arr[i] = color;
            color++;
        }
        else{
            int l = 1 , r = i-1;
            while(l < r){
                int mid = (l + r) / 2;
                cout << mid - l + 2 << " ";
                for(int k=l ; k<=mid ; k++){
                    cout << k << " ";
                }
                cout << i;
                cout << endl;
                cin >> ans;
                if(ans > save[mid]){
                    l = mid + 1;
                }
                else{
                    r = mid;
                }
            }
            arr[i] = arr[l];
        }
    }
    cout << 0 << " ";
    for(int i=1 ; i<=n ; i++){
        cout << arr[i] << " ";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 436 KB Integer 12 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 440 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 440 KB Integer 2 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 440 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 444 KB Integer 3 violates the range [1, 2]
2 Halted 0 ms 0 KB -