Java版样例过了但提交全部WA
  • 板块B2066 救援
  • 楼主GodSaveJava
  • 当前回复5
  • 已保存回复5
  • 发布时间2023/4/10 11:18
  • 上次更新2023/10/23 18:50:12
查看原帖
Java版样例过了但提交全部WA
979307
GodSaveJava楼主2023/4/10 11:18
 import java.util.Scanner; 

	    import java.text.DecimalFormat;
	
	    public class Main {
	       public static void main(String[] args)
	       {  
	         Scanner in = new Scanner(System.in);
	         int n = in.nextInt();
	         double x,y;
	         int number;
	         double way;
	         double time;
	         int Result = 0;
	         for(int i=1;i<=n;i++)
	         {
	        	 x = in.nextDouble();
	        	 y = in.nextDouble();
	        	 number = in.nextInt();
	        	 way = Math.sqrt(x*x+y*y);
	        	 time = way/50+number+way/50+number/2;
	        	 double Time = Math.ceil(time);
	        	 int result = (int)Time;
	        	 Result = Result +result;
	         }
	         System.out.println(Result);
	       }     
	    }
2023/4/10 11:18
加载中...