結果

問題 No.419 直角三角形
ユーザー hermione17hermione17
提出日時 2016-09-09 22:35:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 388 bytes
コンパイル時間 3,555 ms
コンパイル使用メモリ 74,388 KB
実行使用メモリ 54,672 KB
最終ジャッジ日時 2024-04-28 02:16:18
合計ジャッジ時間 7,747 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
54,084 KB
testcase_01 AC 141 ms
53,944 KB
testcase_02 AC 142 ms
53,880 KB
testcase_03 AC 140 ms
54,272 KB
testcase_04 AC 144 ms
54,524 KB
testcase_05 AC 144 ms
53,944 KB
testcase_06 AC 143 ms
53,692 KB
testcase_07 AC 142 ms
53,768 KB
testcase_08 WA -
testcase_09 AC 144 ms
54,316 KB
testcase_10 AC 142 ms
54,088 KB
testcase_11 AC 145 ms
53,620 KB
testcase_12 WA -
testcase_13 AC 143 ms
53,760 KB
testcase_14 AC 143 ms
54,328 KB
testcase_15 AC 139 ms
54,320 KB
testcase_16 AC 143 ms
54,152 KB
testcase_17 AC 137 ms
53,768 KB
testcase_18 AC 142 ms
54,348 KB
testcase_19 AC 141 ms
53,676 KB
testcase_20 AC 143 ms
54,348 KB
testcase_21 AC 142 ms
54,256 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Y419 {
	Y419() {
	    Scanner sc = new Scanner(System.in);
	    double a = sc.nextDouble();
	    double b= sc.nextDouble();
	    
	    if (a > b) {
	    	double tmp = a;
	    	a = b;
	    	b = tmp;
	    }
	    
	    double c = Math.sqrt(b*b - a*a);
	    
	    System.out.println(c);
	}
	public static void main(String argv[]) {
		new Y419();
	}
}
0