把
for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> ch[i][j]; } }
改成
for (int i = 1; i <= n; i++) { cin >> ch[i][j]; }
因为这个调了0.5h