제출 #587090

#제출 시각아이디문제언어결과실행 시간메모리
587090ygim사육제 (CEOI14_carnival)C++17
0 / 100
1 ms312 KiB
// P1_Carnival.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <math.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int n; cin >> n;
    vector<int> costume(n, -1);
    int t = 1;
    for (int i = 0; i < n; i++)
    {
        if (costume[i] != -1) continue;
        costume[i] = t;
        for (int j = i + 1; j < n; j++)
        {
            if (costume[j] != -1) continue;
            cout << 2 << " " << i << " " << j << endl;
            int num; cin >> num;
            if (num == 1) costume[j] = t;
        }
        t++;
    }
    cout << 0 << " ";
    for (int i = 0; i < n; i++) cout << costume[i] << " ";
    cout << endl;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...