답안 #534641

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
534641 2022-03-08T12:28:42 Z katwamiaw 사육제 (CEOI14_carnival) C++14
100 / 100
22 ms 300 KB
#include<bits/stdc++.h>
#define ll long long
using namespace std ;
//fflush(stdout) ;

const int max_n=159 ;

int c[max_n] ;
vector<int>v[max_n] ;
int r=1 ;

int main(){
    int n ; cin >> n ;
    //for(int i=1 ; i<=n ; i++) c[i]=200 ;

    int r=1 ;
    v[1].push_back(1) ;

    for(int i=2 ; i<=n ; i++){
        cout <<  r+1 << ' ';
        for(int j=1 ; j<=r ; j++){
            cout << v[j][0] << ' ' ;
        }
        cout << i << '\n' ;
        fflush(stdout) ;
        int x ; cin >> x ;
        if(x>r){
            r++ ;
            v[r].push_back(i) ;
        }
        else{
            for(int j=1 ; j<=r ; j++){
                cout << "2 " << v[j][0] << ' ' << i << '\n' ;
                fflush(stdout) ;
                int y ; cin >> y ;
                if(y==1){
                    v[j].push_back(i) ;
                    break ;
                }
            }
        }
    }

    for(int i=1 ; i<=r ; i++){
        for(int j:v[i]){
            c[j]=i ;
        }
    }

    cout << 0 << ' ' ;
    for(int i=1 ; i<=n ; i++) cout << c[i] << ' ' ;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 17 ms 200 KB Output is correct
3 Correct 13 ms 300 KB Output is correct
4 Correct 5 ms 200 KB Output is correct
5 Correct 3 ms 200 KB Output is correct
6 Correct 4 ms 200 KB Output is correct
7 Correct 11 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 200 KB Output is correct
2 Correct 15 ms 288 KB Output is correct
3 Correct 6 ms 296 KB Output is correct
4 Correct 9 ms 200 KB Output is correct
5 Correct 4 ms 200 KB Output is correct
6 Correct 4 ms 292 KB Output is correct
7 Correct 6 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 200 KB Output is correct
2 Correct 8 ms 292 KB Output is correct
3 Correct 19 ms 200 KB Output is correct
4 Correct 7 ms 200 KB Output is correct
5 Correct 4 ms 200 KB Output is correct
6 Correct 4 ms 296 KB Output is correct
7 Correct 7 ms 292 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 300 KB Output is correct
2 Correct 8 ms 200 KB Output is correct
3 Correct 15 ms 200 KB Output is correct
4 Correct 4 ms 200 KB Output is correct
5 Correct 7 ms 292 KB Output is correct
6 Correct 6 ms 200 KB Output is correct
7 Correct 21 ms 200 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 300 KB Output is correct
2 Correct 14 ms 200 KB Output is correct
3 Correct 21 ms 296 KB Output is correct
4 Correct 22 ms 292 KB Output is correct
5 Correct 5 ms 200 KB Output is correct
6 Correct 3 ms 200 KB Output is correct
7 Correct 5 ms 296 KB Output is correct