結果

問題 No.419 直角三角形
ユーザー aRac
提出日時 2016-11-23 20:53:20
言語 Scala(Beta)
(3.6.2)
結果
AC  
実行時間 888 ms / 1,000 ms
コード長 305 bytes
コンパイル時間 9,920 ms
コンパイル使用メモリ 248,148 KB
実行使用メモリ 63,012 KB
最終ジャッジ日時 2024-06-29 20:27:01
合計ジャッジ時間 31,919 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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