답안 #595622

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
595622 2022-07-13T22:01:43 Z someone 사육제 (CEOI14_carnival) C++14
0 / 100
5 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);
        }
    }
    for(int i = 0; i < n; i++)
        cout << grp[i]+1 << ' ';
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -