思路;
模拟;
代码:
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define Yes {puts("YES ");return 0;} int ai[5][5]; int main() { for(int i=1;i<=4;i++) { scanf("%d%d%d%d",&ai[i][1],&ai[i][2],&ai[i][3],&ai[i][4]); if((ai[i][1]||ai[i][2]||ai[i][3])&&ai[i][4]) Yes } if((ai[1][1]&&ai[4][4])||(ai[1][2]&&ai[3][4])||(ai[1][3]&&ai[2][4])) Yes if((ai[2][1]&&ai[1][4])||(ai[2][2]&&ai[4][4])||(ai[2][3]&&ai[3][4])) Yes if((ai[3][1]&&ai[2][4])||(ai[3][2]&&ai[1][4])||(ai[3][3]&&ai[4][4])) Yes if((ai[4][1]&&ai[3][4])||(ai[4][2]&&ai[2][4])||(ai[4][3]&&ai[1][4])) Yes printf("NO "); return 0; }