結果
| 問題 |
No.212 素数サイコロと合成数サイコロ (2)
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2015-10-26 11:13:26 |
| 言語 | Haskell (9.10.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 327 bytes |
| コンパイル時間 | 1,692 ms |
| コンパイル使用メモリ | 176,476 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 09:19:14 |
| 合計ジャッジ時間 | 2,398 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
import Text.Printf (printf)
findExpectation :: [Double] -> Double
findExpectation (p : c : _) = ep ** p * ec ** c
where
ep = (2.0 + 3.0 + 5.0 + 7.0 + 11.0 + 13.0) / 6.0
ec = (4.0 + 6.0 + 8.0 + 9.0 + 10.0 + 12.0) / 6.0
main :: IO ()
main = printf "%.11f\n" . findExpectation . map read . words =<< getLine
はむ吉🐹