結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー Michae'Gon
提出日時 2015-07-19 03:15:31
言語 Haskell
(9.10.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 279 bytes
コンパイル時間 5,488 ms
コンパイル使用メモリ 173,312 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 22:32:29
合計ジャッジ時間 4,232 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Control.Applicative
main = getLine >>= print . solve . read

solve :: Int -> Double
solve k = fromIntegral count / 36.0
    where
        count = foldl (\acc x -> if x == k then acc + 1 else acc) 0 muls
        muls = (*) <$> [2, 3, 5, 7, 11, 13] <*> [4, 6, 8, 9, 10, 12]
0