結果

問題 No.419 直角三角形
ユーザー aRacaRac
提出日時 2016-11-23 20:53:20
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 960 ms / 1,000 ms
コード長 305 bytes
コンパイル時間 9,250 ms
コンパイル使用メモリ 250,092 KB
実行使用メモリ 63,244 KB
最終ジャッジ日時 2023-09-12 07:30:21
合計ジャッジ時間 31,450 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 889 ms
61,924 KB
testcase_01 AC 897 ms
62,056 KB
testcase_02 AC 903 ms
61,932 KB
testcase_03 AC 913 ms
61,952 KB
testcase_04 AC 950 ms
62,032 KB
testcase_05 AC 931 ms
61,900 KB
testcase_06 AC 926 ms
61,956 KB
testcase_07 AC 927 ms
62,124 KB
testcase_08 AC 924 ms
61,880 KB
testcase_09 AC 923 ms
63,244 KB
testcase_10 AC 925 ms
61,844 KB
testcase_11 AC 938 ms
62,188 KB
testcase_12 AC 929 ms
62,036 KB
testcase_13 AC 960 ms
62,032 KB
testcase_14 AC 925 ms
62,044 KB
testcase_15 AC 930 ms
62,024 KB
testcase_16 AC 914 ms
62,000 KB
testcase_17 AC 925 ms
61,876 KB
testcase_18 AC 923 ms
61,996 KB
testcase_19 AC 938 ms
62,008 KB
testcase_20 AC 936 ms
61,984 KB
testcase_21 AC 936 ms
61,980 KB
testcase_22 AC 936 ms
62,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

object Main {
    def solve(n: Int, m: Int) = {
        if (n == m) math.sqrt(math.pow(m, 2) + math.pow(n, 2))
        else math.sqrt(math.abs(math.pow(n, 2) - math.pow(m, 2)))
    }
    val Array(a, b) = io.StdIn.readLine.split(" ")
    def main(args: Array[String]) = println(solve(a.toInt, b.toInt))
}
0