結果

問題 No.419 直角三角形
ユーザー Ysmr_RyYsmr_Ry
提出日時 2016-12-23 21:06:29
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 251 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 164,392 KB
実行使用メモリ 7,704 KB
最終ジャッジ日時 2023-08-21 07:41:03
合計ジャッジ時間 2,389 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,704 KB
testcase_01 AC 2 ms
7,660 KB
testcase_02 AC 2 ms
7,668 KB
testcase_03 AC 2 ms
7,612 KB
testcase_04 AC 2 ms
7,564 KB
testcase_05 AC 3 ms
7,540 KB
testcase_06 AC 3 ms
7,544 KB
testcase_07 AC 3 ms
7,572 KB
testcase_08 AC 3 ms
7,588 KB
testcase_09 AC 3 ms
7,612 KB
testcase_10 AC 3 ms
7,628 KB
testcase_11 AC 2 ms
7,556 KB
testcase_12 AC 3 ms
7,600 KB
testcase_13 AC 3 ms
7,556 KB
testcase_14 AC 3 ms
7,668 KB
testcase_15 AC 2 ms
7,564 KB
testcase_16 AC 3 ms
7,592 KB
testcase_17 AC 2 ms
7,600 KB
testcase_18 AC 2 ms
7,556 KB
testcase_19 AC 3 ms
7,636 KB
testcase_20 AC 2 ms
7,616 KB
testcase_21 AC 2 ms
7,676 KB
testcase_22 AC 3 ms
7,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Control.Applicative
import Text.Printf

main :: IO ()
main = do
  [a,b] <- map read . words <$> getLine :: IO [Double]
  let mi = min a b
      ma = max a b

  printf "%.10f\n" $ if mi == ma
    then sqrt (a**2+b**2)
    else sqrt (ma**2-mi**2)
0