結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー finefine
提出日時 2016-01-10 00:26:03
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 263 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 11,956 KB
実行使用メモリ 412,560 KB
最終ジャッジ日時 2023-10-19 19:44:18
合計ジャッジ時間 8,422 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
16,064 KB
testcase_01 AC 117 ms
20,644 KB
testcase_02 AC 87 ms
16,064 KB
testcase_03 AC 116 ms
20,644 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

sosuu = [2,3,5,7,11,13]
gousei = [4,6,8,9,10,12]

P,C = gets.split.map(&:to_i)
pattern = 6 ** (P + C)

p sosuu.repeated_permutation(P).map(&:to_a).product(gousei.repeated_permutation(C).map(&:to_a)).map(&:flatten).map{|a|a.inject(&:*)}.inject(&:+) * 1.0 / pattern
0