結果

問題 No.419 直角三角形
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-15 17:58:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 372 bytes
コンパイル時間 3,904 ms
コンパイル使用メモリ 72,180 KB
実行使用メモリ 56,640 KB
最終ジャッジ日時 2023-08-27 02:24:48
合計ジャッジ時間 8,012 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,864 KB
testcase_01 AC 127 ms
56,052 KB
testcase_02 AC 121 ms
55,756 KB
testcase_03 AC 128 ms
55,724 KB
testcase_04 AC 125 ms
55,972 KB
testcase_05 AC 127 ms
56,012 KB
testcase_06 AC 128 ms
55,600 KB
testcase_07 AC 129 ms
56,148 KB
testcase_08 AC 123 ms
56,124 KB
testcase_09 AC 120 ms
55,960 KB
testcase_10 AC 124 ms
55,928 KB
testcase_11 AC 119 ms
56,084 KB
testcase_12 AC 122 ms
55,964 KB
testcase_13 AC 124 ms
55,724 KB
testcase_14 AC 128 ms
56,640 KB
testcase_15 AC 127 ms
56,188 KB
testcase_16 AC 134 ms
55,728 KB
testcase_17 AC 125 ms
56,116 KB
testcase_18 AC 140 ms
55,948 KB
testcase_19 AC 137 ms
55,932 KB
testcase_20 AC 132 ms
56,180 KB
testcase_21 AC 134 ms
55,896 KB
testcase_22 AC 130 ms
55,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No419 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		
		if(a == b) {
			System.out.println(Math.sqrt(Math.pow(a, 2) * 2));
		}else {
		System.out.println(Math.sqrt(Math.pow(Math.max(a, b), 2) - Math.pow(Math.min(a, b), 2)));
		}
	}
}
0