携程和拼多多,都是为了acm输入输出痛苦orz。我的输入输出是这样的,语言是java: * public static void main(String[] args) { * Scanner in = new Scanner(System.in); * while (in.hasNext()) { * //只有可能理论上已经读完了关卡,要到下一个去了,却到了关卡里面…… * int n = in.nextInt(); * int m = in.nextInt(); * int[][] nums = new int[n][3]; * for(int i = 0; i < n; i++) { * // 给的是字符还是字符串啊 * String s = in.next(); * nums[i][0] = s.charAt(0); * nums[i][1] = in.nextInt(); * nums[i][2] = nums[i][0] - 'm' == 0? in.nextInt() : 0; * } * System.out.println(solution(nums)); * } * }不知道会不会乱码,放上图片: