結果

問題 No.419 直角三角形
ユーザー HujiLeeHujiLee
提出日時 2016-11-25 23:34:55
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 979 ms / 1,000 ms
コード長 413 bytes
コンパイル時間 9,282 ms
コンパイル使用メモリ 263,652 KB
実行使用メモリ 62,584 KB
最終ジャッジ日時 2023-09-12 07:38:25
合計ジャッジ時間 32,753 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 979 ms
62,524 KB
testcase_01 AC 945 ms
62,240 KB
testcase_02 AC 934 ms
62,232 KB
testcase_03 AC 945 ms
62,288 KB
testcase_04 AC 929 ms
62,144 KB
testcase_05 AC 944 ms
62,240 KB
testcase_06 AC 946 ms
62,328 KB
testcase_07 AC 931 ms
62,288 KB
testcase_08 AC 928 ms
62,276 KB
testcase_09 AC 943 ms
62,268 KB
testcase_10 AC 927 ms
62,312 KB
testcase_11 AC 935 ms
62,364 KB
testcase_12 AC 946 ms
62,276 KB
testcase_13 AC 934 ms
62,400 KB
testcase_14 AC 942 ms
62,412 KB
testcase_15 AC 933 ms
62,324 KB
testcase_16 AC 941 ms
62,120 KB
testcase_17 AC 949 ms
62,584 KB
testcase_18 AC 953 ms
62,184 KB
testcase_19 AC 933 ms
62,068 KB
testcase_20 AC 938 ms
62,116 KB
testcase_21 AC 938 ms
62,208 KB
testcase_22 AC 938 ms
62,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import scala.io.StdIn

/**
  * Created by Administrator on 2016/11/25 0025.
  */
object Main extends App {
  val Array(a, b) = StdIn.readLine().split(" ").map(x => x.toInt)
  val long = math.max(a, b)
  val short = math.min(a, b)
  if(long!=short){
    println(
      math.pow(
        1*math.pow(long,2)-math.pow(short,2)
        , 0.5
      )
    )
  }else{
    println(
      math.pow(2,0.5)*long
    )
  }


}
0