結果

問題 No.419 直角三角形
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-27 21:12:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 387 bytes
コンパイル時間 2,168 ms
コンパイル使用メモリ 74,512 KB
実行使用メモリ 54,432 KB
最終ジャッジ日時 2024-05-01 16:16:40
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
53,612 KB
testcase_01 AC 126 ms
54,188 KB
testcase_02 AC 128 ms
54,432 KB
testcase_03 AC 125 ms
53,400 KB
testcase_04 AC 126 ms
53,864 KB
testcase_05 AC 132 ms
54,176 KB
testcase_06 AC 113 ms
53,652 KB
testcase_07 AC 120 ms
53,660 KB
testcase_08 AC 135 ms
54,076 KB
testcase_09 AC 140 ms
54,000 KB
testcase_10 AC 116 ms
53,504 KB
testcase_11 AC 136 ms
53,880 KB
testcase_12 AC 118 ms
53,720 KB
testcase_13 AC 130 ms
54,152 KB
testcase_14 AC 123 ms
53,688 KB
testcase_15 AC 138 ms
54,260 KB
testcase_16 AC 137 ms
54,240 KB
testcase_17 AC 131 ms
54,148 KB
testcase_18 AC 131 ms
54,276 KB
testcase_19 AC 130 ms
54,036 KB
testcase_20 AC 127 ms
53,892 KB
testcase_21 AC 121 ms
53,660 KB
testcase_22 AC 117 ms
53,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double b = sc.nextDouble();
    double m = Math.min(a, b);
    double M = Math.max(a, b);
    double ans = (double)Math.sqrt(M * M - m * m);
    if(m == M) ans = (double)Math.sqrt(2 * m * m);
    System.out.println(ans);
  }
}
0