为啥会有用例是错的呢?求大佬解答
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt(); // 读取参与集训的 OIer 数量
int m = scanner.nextInt(); // 读取模拟赛题的数量
int k = scanner.nextInt(); // 读取天数
boolean[][] f = new boolean[1010][1010]; // 创建一个二维布尔数组,大小为 1010 x 1010,用于记录每个人在每一天是否有空打模拟赛
for (int i = 1; i <= n; i++) { // 遍历每个人
for (int j = 1; j <= m; j++) { // 遍历每一天
int x = scanner.nextInt(); // 读取第 i 个人在第 j 天是否有空打模拟赛
f[i][x] = true; // 如果有空,则在数组中标记为 true
}
}
for (int i = 1; i <= k; i++) { // 遍历接下来的 k 天
int sum = 0; // 初始化该天需要准备的模拟赛场数
for (int j = 1; j <= n; j++) { // 遍历每个人
if (f[j][i]) { // 如果有空
sum++; // 该天需要准备的模拟赛场数加一
}
}
System.out.print(sum + " "); // 输出该天需要准备的模拟赛场数
}
}
}