結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー yocto_sothothyocto_sothoth
提出日時 2020-12-05 23:10:25
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 287 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 11,172 KB
実行使用メモリ 31,208 KB
最終ジャッジ日時 2023-10-14 10:04:37
合計ジャッジ時間 9,578 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
31,208 KB
testcase_01 AC 100 ms
15,400 KB
testcase_02 AC 90 ms
15,280 KB
testcase_03 AC 93 ms
15,696 KB
testcase_04 AC 1,216 ms
15,680 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

p, c = gets.split.map(&:to_i)
prime = Prime.each(13).to_a
composite = Array(2..13) - prime
sum = 0.0

prime.repeated_permutation(p).each do |x|
  composite.repeated_permutation(c).each do |y|
    sum += x.inject(1, :*) * y.inject(1, :*)
  end
end

puts sum / 6**(p + c)
0