結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー tottoripapertottoripaper
提出日時 2015-05-22 22:35:26
言語 Haskell
(9.8.2)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 357 bytes
コンパイル時間 825 ms
コンパイル使用メモリ 165,156 KB
実行使用メモリ 12,500 KB
最終ジャッジ日時 2023-09-20 09:34:41
合計ジャッジ時間 8,587 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,460 KB
testcase_01 AC 5 ms
8,952 KB
testcase_02 AC 3 ms
7,520 KB
testcase_03 AC 4 ms
8,848 KB
testcase_04 AC 132 ms
11,660 KB
testcase_05 TLE -
testcase_06 AC 892 ms
12,376 KB
testcase_07 AC 762 ms
11,948 KB
testcase_08 AC 4 ms
7,932 KB
testcase_09 AC 3 ms
7,992 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.Monad
import Text.Printf
main = do
  [p, c] <- liftM (map read . words) getLine
  let
    s = sum (do
              xs <- replicateM p [2,3,5,7,11,13]
              ys <- replicateM c [4,6,8,9,10,12]
              return $ product xs * product ys)
    e :: Double
    e = fromIntegral s / (6 ** fromIntegral (p + c))
   in printf "%.13f\n" e
0