結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー tottoripapertottoripaper
提出日時 2015-05-22 22:35:26
言語 Haskell
(9.2.2)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 357 bytes
コンパイル時間 3,361 ms
使用メモリ 9,156 KB
最終ジャッジ日時 2023-02-08 18:32:58
合計ジャッジ時間 12,259 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
4,296 KB
testcase_01 AC 4 ms
5,768 KB
testcase_02 AC 2 ms
4,248 KB
testcase_03 AC 3 ms
5,632 KB
testcase_04 AC 140 ms
8,464 KB
testcase_05 TLE -
testcase_06 AC 978 ms
9,156 KB
testcase_07 AC 825 ms
8,792 KB
testcase_08 AC 3 ms
4,816 KB
testcase_09 AC 3 ms
4,752 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.2.2/environments/default
[1 of 1] Compiling Main             ( Main.hs, Main.o )
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