Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
139979 | 梁乃元 | 派对灯 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 1329 | 2024-03-27 13:58:48 |
# include <bits/stdc++.h> using namespace std ; int flag [7] , n , c , OK , state[9] [7] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 0 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 1 , 2 , 1 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 1 , 0 , 2 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , } ; int loc ( int x ) { rt ( x % 6 == 0 ? 6 : x % 6 ) ; } int Check ( int s) { if ( state [s] [0] > c ) { return 0 ; } if ( c == 2 && s == 4 ) { return 0; } if ( c == 3 && ( s == 2 || s == 5 || s == 7 ) ) ) { return 0; } if ( c == 1 && s == 8 ) { return 0 ; } for ( int i = 1 ; i <= 6 ; i ++ ) { if ( ! flag [i] - 1 ) { continue ; } if ( state [s] [i] != flag [i] ) { return 0; } } return 1; } int main ( ) { memset ( flg , -1 , sizeof ( flg ) ) ; cin >> n >> c ; while ( cin >> k && k != -1 ) { flg [loc ( k )] = 1 ; } while ( cin >> k && k != -1 ) { flg [loc ( k )] = 0 ; } for ( int i = 1 ; i <= 8 ; i ++ ) { if ( chk ( i ) ) { for ( int j = 1 ; j <= n ; j ++ ) { cout << stt [i] [loc ( j )] ; } cout << endl ; flag = 1 ; } } if ( ! flag ) { cout << "IMPOSSIBLE" << endl ; } rt 0 ; }urn 0; }