結果

問題 No.419 直角三角形
ユーザー 37zigen37zigen
提出日時 2016-09-10 01:34:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 3,261 ms
コンパイル使用メモリ 71,404 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2023-08-10 13:14:18
合計ジャッジ時間 7,569 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
56,544 KB
testcase_01 AC 135 ms
56,760 KB
testcase_02 AC 133 ms
56,020 KB
testcase_03 AC 133 ms
56,600 KB
testcase_04 AC 136 ms
56,176 KB
testcase_05 AC 137 ms
54,108 KB
testcase_06 AC 131 ms
56,256 KB
testcase_07 AC 134 ms
56,060 KB
testcase_08 AC 135 ms
56,228 KB
testcase_09 AC 137 ms
55,772 KB
testcase_10 AC 137 ms
56,072 KB
testcase_11 AC 134 ms
57,984 KB
testcase_12 AC 136 ms
56,296 KB
testcase_13 AC 137 ms
56,076 KB
testcase_14 AC 135 ms
55,988 KB
testcase_15 AC 135 ms
56,284 KB
testcase_16 AC 136 ms
56,076 KB
testcase_17 AC 135 ms
56,068 KB
testcase_18 AC 133 ms
55,860 KB
testcase_19 AC 133 ms
56,668 KB
testcase_20 AC 140 ms
56,024 KB
testcase_21 AC 135 ms
56,132 KB
testcase_22 AC 135 ms
55,824 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