Submission #114026

# Submission time Handle Problem Language Result Execution time Memory
114026 2019-05-29T15:38:37 Z dolphingarlic Carnival (CEOI14_carnival) C++14
0 / 100
7 ms 384 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define FOR(i, x, y) for(int i = x; i < y; i++)
typedef long long ll;
using namespace std;

int a[151];

void solve(int lower, int upper, int l, int r) {
    if (l == r) a[l] = lower;
    else {
        int mid = (l + r) / 2;
        cout << mid - l + 1 << ' ';
        FOR(i, l, mid + 1) cout << i << ' ';
        cout << endl;
        int k;
        cin >> k;
        solve(lower, lower + k - 1, l, mid);
        cout << r - mid << ' ';
        FOR(i, mid + 1, r + 1) cout << i << ' ';
        cout << endl;
        cin >> k;
        solve(upper - k + 1, upper, mid + 1, r);
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    cout << n << ' ';
    FOR(i, 1, n + 1) cout << i << ' ';
    cout << endl;
    int k;
    cin >> k;
    solve(1, k, 1, n);
    cout << "0 ";
    FOR(i, 1, n + 1) cout << a[i] << ' ';
    cout << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Incorrect 4 ms 384 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -