結果
| 問題 | No.419 直角三角形 |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-09-10 12:01:52 |
| 言語 | Haskell (9.14.1) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 352 bytes |
| 記録 | |
| コンパイル時間 | 3,996 ms |
| コンパイル使用メモリ | 198,528 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-05-12 01:31:22 |
| 合計ジャッジ時間 | 5,183 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Control.Applicative ((<$>))
import Text.Printf (printf)
solve :: RealFloat a => a -> a -> a
solve a b
| c /= d = sqrt $ d * d - c * c
| otherwise = sqrt $ c * c + d * d
where
c = min a b
d = max a b
main :: IO ()
main = do
[a, b] <- fmap read . words <$> getLine :: IO [Double]
printf "%.12f\n" $ solve a b
はむ吉🐹