結果

問題 No.419 直角三角形
ユーザー 37zigen37zigen
提出日時 2016-09-10 01:34:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 149 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 3,379 ms
コンパイル使用メモリ 74,952 KB
実行使用メモリ 41,816 KB
最終ジャッジ日時 2024-04-28 06:27:11
合計ジャッジ時間 7,729 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
40,488 KB
testcase_01 AC 142 ms
41,404 KB
testcase_02 AC 131 ms
41,020 KB
testcase_03 AC 139 ms
41,264 KB
testcase_04 AC 127 ms
40,720 KB
testcase_05 AC 139 ms
41,460 KB
testcase_06 AC 139 ms
41,184 KB
testcase_07 AC 142 ms
41,520 KB
testcase_08 AC 147 ms
41,132 KB
testcase_09 AC 142 ms
41,092 KB
testcase_10 AC 147 ms
41,524 KB
testcase_11 AC 130 ms
40,772 KB
testcase_12 AC 149 ms
41,524 KB
testcase_13 AC 145 ms
41,816 KB
testcase_14 AC 128 ms
40,796 KB
testcase_15 AC 142 ms
40,612 KB
testcase_16 AC 133 ms
40,364 KB
testcase_17 AC 141 ms
41,524 KB
testcase_18 AC 145 ms
41,448 KB
testcase_19 AC 131 ms
41,088 KB
testcase_20 AC 129 ms
40,772 KB
testcase_21 AC 132 ms
40,620 KB
testcase_22 AC 140 ms
41,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package No400番台;

import java.util.Scanner;

public class Q419 {
	public static void main(String[] args) {
		new Q419().solver();
	}

	void solver() {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		double ans = -1;
		if (a != b)
			ans = Math.sqrt(Math.abs(a * a - b * b));
		else
			ans = Math.sqrt(a * a + b * b);
		System.out.println(ans);
	}
}
0