結果

問題 No.419 直角三角形
ユーザー TatsuyaObaTatsuyaOba
提出日時 2016-12-18 13:49:13
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 939 ms / 1,000 ms
コード長 317 bytes
コンパイル時間 8,181 ms
コンパイル使用メモリ 252,020 KB
実行使用メモリ 62,380 KB
最終ジャッジ日時 2023-09-12 09:01:22
合計ジャッジ時間 31,435 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 925 ms
62,096 KB
testcase_01 AC 928 ms
62,068 KB
testcase_02 AC 922 ms
61,896 KB
testcase_03 AC 931 ms
62,008 KB
testcase_04 AC 938 ms
62,056 KB
testcase_05 AC 933 ms
61,948 KB
testcase_06 AC 921 ms
62,056 KB
testcase_07 AC 926 ms
61,996 KB
testcase_08 AC 930 ms
62,380 KB
testcase_09 AC 928 ms
62,084 KB
testcase_10 AC 923 ms
62,020 KB
testcase_11 AC 924 ms
62,228 KB
testcase_12 AC 939 ms
62,156 KB
testcase_13 AC 932 ms
61,908 KB
testcase_14 AC 923 ms
61,920 KB
testcase_15 AC 928 ms
62,276 KB
testcase_16 AC 931 ms
61,772 KB
testcase_17 AC 929 ms
61,920 KB
testcase_18 AC 927 ms
62,112 KB
testcase_19 AC 933 ms
61,888 KB
testcase_20 AC 934 ms
61,912 KB
testcase_21 AC 928 ms
61,912 KB
testcase_22 AC 922 ms
61,972 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((A, B) match {
      case (a, b) if a == b => math.sqrt(a * a + b * b)
      case _ => math.sqrt(math.abs(A * A - B * B))
    })
  }
}
0