Submission #595624

# Submission time Handle Problem Language Result Execution time Memory
595624 2022-07-13T22:05:57 Z someone Carnival (CEOI14_carnival) C++14
0 / 100
7 ms 208 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;

const int N = 2e5 + 42, INF = 1e18;

vector<int> id;
int n, curDiff = 1, grp[N];

int getNbDiff(int deb, int fin, int cible) {
    cout << fin - deb + 1 << ' ' << cible+1;
    for(int j = deb; j < fin; j++)
        cout << ' ' << id[j] + 1;
    cout << '\n';
    cout.flush();

    int ans;
    cin >> ans;
    return ans;
}

void dicho(int deb, int fin, int cible) {
    if(deb + 1 == fin) {
        grp[cible] = grp[id[deb]];
        return;
    }
    int mid = (deb + fin) >> 1;
    if(getNbDiff(deb, mid, cible) == mid - deb)
        dicho(deb, mid, cible);
    else
        dicho(mid, fin, cible);
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    id.push_back(0);
    for(int i = 1; i < n; i++) {
        int ans = getNbDiff(0, curDiff, i);
        if(ans == curDiff+1) {
            grp[i] = curDiff;
            curDiff++;
            id.push_back(i);
        } else {
            dicho(0, curDiff, i);
        }
    }
    cout << 0 << ' ';
    for(int i = 0; i < n; i++)
        cout << grp[i]+1;
    cout.flush();
}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 208 KB Expected integer, but "123456786910167148101156328328...0938585961810114739251032198811" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 208 KB Expected integer, but "122345333312152255324142532313...5332442521215421222322514421243" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Expected integer, but "111111111111111111111111111111...1111111111111111111111111111111" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 208 KB Expected integer, but "121344434422342224141244113212...3342431434134234232442413321221" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 208 KB Expected integer, but "122211212112112122122221212212...1112122221222112211111111222221" found
2 Halted 0 ms 0 KB -