結果

問題 No.419 直角三角形
ユーザー maninimanini
提出日時 2016-09-11 01:12:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 2,545 ms
コンパイル使用メモリ 73,916 KB
実行使用メモリ 41,180 KB
最終ジャッジ日時 2024-04-28 10:09:35
合計ジャッジ時間 5,712 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
41,108 KB
testcase_01 AC 107 ms
41,180 KB
testcase_02 AC 106 ms
40,904 KB
testcase_03 AC 104 ms
39,992 KB
testcase_04 AC 95 ms
39,988 KB
testcase_05 AC 97 ms
40,128 KB
testcase_06 AC 104 ms
39,732 KB
testcase_07 AC 105 ms
41,024 KB
testcase_08 WA -
testcase_09 AC 95 ms
40,016 KB
testcase_10 AC 108 ms
41,000 KB
testcase_11 AC 108 ms
39,640 KB
testcase_12 WA -
testcase_13 AC 98 ms
40,032 KB
testcase_14 AC 103 ms
41,004 KB
testcase_15 AC 107 ms
39,736 KB
testcase_16 AC 107 ms
41,004 KB
testcase_17 AC 112 ms
39,764 KB
testcase_18 AC 113 ms
39,760 KB
testcase_19 AC 97 ms
39,908 KB
testcase_20 AC 115 ms
40,300 KB
testcase_21 AC 113 ms
41,156 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long a=s.nextInt();
		long b=s.nextInt();
		if(a!=b){
		long max=Math.max(a, b);
		long min=Math.min(a, b);
		
		double c=Math.sqrt((double)max*max-min*min);
		System.out.println(c);
		}else{
			double c=Math.sqrt((double)a*a-b*b);
			System.out.println(c);
		}
	}
}
0