Problem 1003 Java提交,全部返回-1,都直接报超时,没有任何复杂度,只有输入

ouyangshengduo | 2017-08-06 16:19:34Author
Java提交,全部返回-1,都直接报超时,没有任何复杂度,只有输入,到底是怎么输入的
ouyangshengduo | 2017-08-06 16:20:53# 1
/** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner (System.in); int master_count,skill_count; while(in.hasNextInt()){ int maxDefense = 0; int maxDamage = 0; int maxLife = 0; //怪兽数量以及技能数量输入 master_count = in.nextInt(); skill_count = in.nextInt(); //怪兽属性信息输入 for(int index = 0 ; index < master_count ; index ++){ master_life[index] = in.nextInt(); master_defense[index] = in.nextInt(); maxDefense = findMax(maxDefense,master_defense[index]); maxLife = findMax(maxLife,master_life[index]); } //技能属性信息输入 for(int index = 0 ; index < skill_count ; index ++){ skill_consume[index] = in.nextInt(); skill_damage[index] = in.nextInt(); maxDamage = findMax(maxDamage,skill_damage[index]); } if(maxDamage <= maxDefense ){ System.out.println(\"-1\"); }else{ System.out.println(\"-1\"); } }