結果

問題 No.419 直角三角形
ユーザー TatsuyaObaTatsuyaOba
提出日時 2016-12-18 13:52:01
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 949 ms / 1,000 ms
コード長 300 bytes
コンパイル時間 8,461 ms
コンパイル使用メモリ 244,368 KB
実行使用メモリ 62,164 KB
最終ジャッジ日時 2023-09-12 09:01:54
合計ジャッジ時間 31,469 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 926 ms
62,148 KB
testcase_01 AC 936 ms
62,068 KB
testcase_02 AC 933 ms
61,792 KB
testcase_03 AC 921 ms
62,164 KB
testcase_04 AC 921 ms
61,892 KB
testcase_05 AC 940 ms
62,044 KB
testcase_06 AC 942 ms
61,848 KB
testcase_07 AC 934 ms
61,892 KB
testcase_08 AC 934 ms
61,932 KB
testcase_09 AC 946 ms
61,836 KB
testcase_10 AC 934 ms
61,960 KB
testcase_11 AC 949 ms
61,896 KB
testcase_12 AC 945 ms
62,164 KB
testcase_13 AC 937 ms
61,884 KB
testcase_14 AC 933 ms
62,044 KB
testcase_15 AC 938 ms
61,996 KB
testcase_16 AC 928 ms
61,808 KB
testcase_17 AC 936 ms
61,780 KB
testcase_18 AC 940 ms
61,856 KB
testcase_19 AC 932 ms
61,960 KB
testcase_20 AC 925 ms
61,836 KB
testcase_21 AC 936 ms
61,872 KB
testcase_22 AC 932 ms
61,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn

object Main {
  def main(args: Array[String]): Unit = {
    val in = StdIn.readLine().split(" ").map(_.toInt)
    val A = in(0)
    val B = in(1)
    println(
      if (A == B)
        math.sqrt(A * A + B * B)
      else
        math.sqrt(math.abs(A * A - B * B))
    )
  }
}
0