結果

問題 No.58 イカサマなサイコロ
ユーザー finefine
提出日時 2016-03-29 20:05:03
言語 Ruby
(3.3.0)
結果
AC  
実行時間 4,251 ms / 5,000 ms
コード長 275 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-10 05:52:21
合計ジャッジ時間 25,976 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,155 ms
12,160 KB
testcase_01 AC 4,251 ms
12,288 KB
testcase_02 AC 1,165 ms
12,288 KB
testcase_03 AC 735 ms
12,416 KB
testcase_04 AC 2,733 ms
12,160 KB
testcase_05 AC 3,126 ms
12,160 KB
testcase_06 AC 3,905 ms
12,160 KB
testcase_07 AC 1,154 ms
12,288 KB
testcase_08 AC 2,000 ms
12,160 KB
testcase_09 AC 3,897 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
k = gets.to_i
c = 0
1000000.times{|i|
    t = j = 0
    (n - k).times{
        t += rand(1..6)
        j += rand(1..6)
        }
    k.times{
        t += rand(4..6)
        j += rand(1..6)
        }
    if t > j
        c += 1
    end
    }
p c * 1.0 / 1000000
0