답안 #574815

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
574815 2022-06-09T12:17:11 Z birthdaycake 사육제 (CEOI14_carnival) C++17
20 / 100
107 ms 5132 KB
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;
 


vector<int>adj[200001];

int vs[151]; int c;

void dfs(int x){
    vs[x] = c;
    for(auto s:adj[x]){
        if(!vs[s]){
            vs[s] = c;
            dfs(s);
        }
    }
}
signed main(){
 
    int n; cin >> n;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            cout << 2 << ' ' << i +1 << ' ' << j + 1 << endl;
            int a; cin >> a;
            if(a == 1){
                adj[i].push_back(j);
            }
        }
    }
    for(int i = 0; i < n; i++){
        if(!vs[i]){
            c++;
            dfs(i);
        }
    }
    cout << 0 << ' ' ;
    for(int i = 0; i < n;i++){
        cout << vs[i] << ' ';
    }
    cout << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 74 ms 4980 KB Partially correct
2 Partially correct 40 ms 4980 KB Partially correct
3 Partially correct 51 ms 4944 KB Partially correct
4 Partially correct 86 ms 4944 KB Partially correct
5 Partially correct 73 ms 5124 KB Partially correct
6 Partially correct 91 ms 5128 KB Partially correct
7 Partially correct 82 ms 4976 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 61 ms 4996 KB Partially correct
2 Partially correct 91 ms 4976 KB Partially correct
3 Partially correct 57 ms 4944 KB Partially correct
4 Partially correct 93 ms 4944 KB Partially correct
5 Partially correct 102 ms 5132 KB Partially correct
6 Partially correct 96 ms 5120 KB Partially correct
7 Partially correct 89 ms 4944 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 82 ms 5032 KB Partially correct
2 Partially correct 83 ms 5000 KB Partially correct
3 Partially correct 59 ms 4984 KB Partially correct
4 Partially correct 97 ms 4944 KB Partially correct
5 Partially correct 94 ms 5008 KB Partially correct
6 Partially correct 84 ms 5124 KB Partially correct
7 Partially correct 77 ms 4944 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 83 ms 5004 KB Partially correct
2 Partially correct 48 ms 4996 KB Partially correct
3 Partially correct 91 ms 4944 KB Partially correct
4 Partially correct 90 ms 4944 KB Partially correct
5 Partially correct 84 ms 5004 KB Partially correct
6 Partially correct 97 ms 5000 KB Partially correct
7 Partially correct 96 ms 4944 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 71 ms 5120 KB Partially correct
2 Partially correct 85 ms 5064 KB Partially correct
3 Partially correct 44 ms 4944 KB Partially correct
4 Partially correct 107 ms 4944 KB Partially correct
5 Partially correct 80 ms 4984 KB Partially correct
6 Partially correct 64 ms 4984 KB Partially correct
7 Partially correct 102 ms 4944 KB Partially correct