Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
139980 梁乃元 派对灯 C++ Compile Error 0 0 MS 0 KB 1324 2024-03-27 13:59:09

Tests(0/0):


# 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 ; } return 0 ; }


Judgement Protocol: