Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
139960 | 梁乃元 | 派对灯 | C++ | 解答错误 | 25 | 0 MS | 252 KB | 1429 | 2024-03-27 13:38:20 |
# include <bits/stdc++.h> # define fs fixed << setprecision # define wt while ( 1 ) # define ld long double # define ll long long # define ctn continue # define brk break # define rt return using namespace std ; int flg [7] , n , c ; bool flag ; int stt [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 ) ; } bool chk ( int s ) { if ( stt [s] [0] > c || ( c == 2 && s == 4 ) || ( c == 3 && ( s == 2 || s == 5 || s == 7 ) ) || ( c == 1 && s == 8 ) ) { rt 0 ; } for ( int i = 1 ; i <= 6 ; i ++ ) { if ( flg [i] == -1 ) { continue ; } if ( stt [s] [i] != flg [i] ) { rt 0 ; } } rt 1 ; } int main ( ) { memset ( flg , -1 , 6 ) ; cin >> n >> c ; int k = 0 ; while ( k != -1 ) { cin >> k ; flg [loc ( k )] = 1 ; } k = 0 ; while ( k != -1 ) { cin >> k ; 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 ; }