結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー tottoripapertottoripaper
提出日時 2015-05-22 22:49:27
言語 Haskell
(9.8.2)
結果
AC  
実行時間 1,373 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 3,096 ms
コンパイル使用メモリ 164,664 KB
実行使用メモリ 12,464 KB
最終ジャッジ日時 2023-09-20 09:46:05
合計ジャッジ時間 3,534 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,552 KB
testcase_01 AC 5 ms
8,984 KB
testcase_02 AC 3 ms
7,520 KB
testcase_03 AC 5 ms
9,512 KB
testcase_04 AC 52 ms
11,700 KB
testcase_05 AC 1,373 ms
12,464 KB
testcase_06 AC 242 ms
12,408 KB
testcase_07 AC 242 ms
12,008 KB
testcase_08 AC 3 ms
7,764 KB
testcase_09 AC 3 ms
8,028 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 #

-- Ω\・8・)チューン,Ω\・8・)チューン,Ω\・8・)チューン

import Control.Monad
import Control.Applicative
import Text.Printf
    
main = do
  [p, c] <- liftM (map read . words) getLine
  let
    s = sum $ (*) <$> (map product (replicateM p [2,3,5,7,11,13])) <*> (map product (replicateM c [4,6,8,9,10,12]))
    e :: Double
    e = fromIntegral s / (6 ** fromIntegral (p + c))
   in printf "%.13f\n" e
0