結果

問題 No.419 直角三角形
ユーザー ym678ym678
提出日時 2016-09-27 13:00:33
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 2,515 ms
コンパイル使用メモリ 73,976 KB
実行使用メモリ 44,380 KB
最終ジャッジ日時 2024-05-01 05:41:50
合計ジャッジ時間 6,468 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
41,564 KB
testcase_01 AC 121 ms
41,440 KB
testcase_02 AC 119 ms
41,460 KB
testcase_03 AC 121 ms
41,420 KB
testcase_04 AC 124 ms
41,440 KB
testcase_05 AC 126 ms
41,468 KB
testcase_06 AC 120 ms
41,472 KB
testcase_07 AC 121 ms
41,524 KB
testcase_08 WA -
testcase_09 AC 120 ms
41,556 KB
testcase_10 AC 105 ms
41,136 KB
testcase_11 AC 122 ms
41,264 KB
testcase_12 WA -
testcase_13 AC 131 ms
41,492 KB
testcase_14 AC 121 ms
41,080 KB
testcase_15 AC 124 ms
41,560 KB
testcase_16 AC 122 ms
44,380 KB
testcase_17 AC 122 ms
41,472 KB
testcase_18 AC 130 ms
41,540 KB
testcase_19 AC 129 ms
41,364 KB
testcase_20 AC 132 ms
41,328 KB
testcase_21 AC 133 ms
41,560 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		int b = scn.nextInt();
		
		if(a<b){
			int sub = a;
			a = b;
			b = sub; 
		}
		double ans = Math.sqrt(a*a-b*b);
		
		System.out.println(ans);

	}
}
0