結果

問題 No.419 直角三角形
ユーザー takeya_okinotakeya_okino
提出日時 2017-10-27 21:11:34
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 4,183 ms
コンパイル使用メモリ 73,652 KB
実行使用メモリ 54,728 KB
最終ジャッジ日時 2024-05-01 16:16:33
合計ジャッジ時間 9,560 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,080 KB
testcase_01 AC 136 ms
54,260 KB
testcase_02 AC 136 ms
53,904 KB
testcase_03 AC 142 ms
54,148 KB
testcase_04 AC 141 ms
54,492 KB
testcase_05 AC 129 ms
54,380 KB
testcase_06 AC 141 ms
54,456 KB
testcase_07 AC 139 ms
54,500 KB
testcase_08 WA -
testcase_09 AC 136 ms
54,236 KB
testcase_10 AC 142 ms
54,180 KB
testcase_11 AC 143 ms
54,328 KB
testcase_12 WA -
testcase_13 AC 136 ms
54,244 KB
testcase_14 AC 147 ms
54,128 KB
testcase_15 AC 138 ms
54,164 KB
testcase_16 AC 141 ms
54,244 KB
testcase_17 AC 143 ms
54,280 KB
testcase_18 AC 140 ms
54,360 KB
testcase_19 AC 147 ms
53,872 KB
testcase_20 AC 140 ms
53,948 KB
testcase_21 AC 138 ms
54,276 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

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);
    System.out.println(ans);
  }
}
0