結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー Tsuneo YoshiokaTsuneo Yoshioka
提出日時 2015-05-22 23:05:20
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 347 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 20,404 KB
最終ジャッジ日時 2023-09-20 09:53:24
合計ジャッジ時間 7,948 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,108 KB
testcase_01 AC 85 ms
15,260 KB
testcase_02 AC 82 ms
15,108 KB
testcase_03 AC 84 ms
15,280 KB
testcase_04 AC 408 ms
15,772 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

P,C=gets.split.map(&:to_i)
def go(pos, p, limit, num)
    if(pos==limit)
        return num
    end
    ar=nil
    if(pos<p)
        ar = [2,3,5,7,11,13]
    else
        ar = [4,6,8,9,10,12]
    end
    total = 0
    ar.map{|i|
        total += go(pos+1, p, limit, num*i)
    }
    return total
end
puts 1.0 * go(0, P, P+C, 1) / (6**(P+C) * 1.0)
0