- ©«¤l
- 20
- ¥DÃD
- 13
- ºëµØ
- 0
- ¿n¤À
- 35
- ÂI¦W
- 1
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- excel 2010
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2025-1-7
- ³Ì«áµn¿ý
- 2025-1-16
|
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(){
int n , m ;
scanf("%d",&n);
scanf("%d",&m);
int borad[15][m][m];
int diagonal[n][2];
int bingo[15][2][m];
for (int p = 0; p < n; p++) {
for (int col = 0 ; col < m; col++) {
for (int row = 0; row < m; row++) {
scanf("%d",&borad[p][col][row]);
}
}
}
memset(diagonal, 0, sizeof(diagonal));
memset(bingo, 0, sizeof(bingo));
int number_list[m*m];
for (int i = 0; i < m * m ; i++) {
scanf("%d",&number_list[i]);
}
printf("\n");
int flag_bingo = 0 ;
int flag_fast = 0 ;
int first = 1 ;
for (int number = 0; number < m * m && flag_bingo == 0 ; number++) {
for (int p = 0; p < n ; p++) {
flag_fast = 0 ;
for (int col = 0; col < m && flag_fast == 0; col++) {
for (int row = 0; row < m && flag_fast == 0; row++) {
if (number_list[number] == borad[p][col][row]) {
bingo[p][0][row]++ ;
bingo[p][1][col]++ ;
if (col == row) {
diagonal[p][0]++;
}
if (col + row == m - 1) {
diagonal[p][1]++;
}
if (bingo[p][0][row] == m || bingo[p][1][col] == m || diagonal[p][0] == m || diagonal[p][1] == m ) {
if (first) {
printf("%d",number_list[number]);
printf(" %d",p);
first = 0 ;
flag_bingo = 1 ;
}
else
printf(" %d",p);
}
}
}
}
}
}
return 0 ;} |
|