結果

問題 No.419 直角三角形
ユーザー fjafjafjafjafjafja
提出日時 2017-09-11 00:16:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 312 bytes
コンパイル時間 3,487 ms
コンパイル使用メモリ 74,528 KB
実行使用メモリ 41,292 KB
最終ジャッジ日時 2024-04-25 03:14:57
合計ジャッジ時間 6,860 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
41,216 KB
testcase_01 AC 121 ms
41,088 KB
testcase_02 AC 113 ms
40,148 KB
testcase_03 AC 125 ms
41,136 KB
testcase_04 AC 125 ms
41,096 KB
testcase_05 AC 112 ms
39,828 KB
testcase_06 AC 125 ms
41,064 KB
testcase_07 AC 121 ms
41,144 KB
testcase_08 AC 126 ms
41,076 KB
testcase_09 AC 126 ms
41,088 KB
testcase_10 AC 127 ms
41,164 KB
testcase_11 AC 107 ms
39,976 KB
testcase_12 AC 126 ms
40,872 KB
testcase_13 AC 126 ms
40,944 KB
testcase_14 AC 129 ms
41,292 KB
testcase_15 AC 129 ms
40,888 KB
testcase_16 AC 122 ms
41,160 KB
testcase_17 AC 117 ms
40,264 KB
testcase_18 AC 109 ms
39,992 KB
testcase_19 AC 121 ms
41,248 KB
testcase_20 AC 111 ms
40,108 KB
testcase_21 AC 116 ms
40,412 KB
testcase_22 AC 128 ms
40,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class N419
{

	public static void main(String[] args)
	{
		Scanner sc=new Scanner (System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		double c=0;
		if(a!=b){c=Math.sqrt(Math.abs(a*a-b*b));}
		else{c=Math.sqrt(a*a+b*b);}
		System.out.printf("%.7f\n",c);
	}

}
0