結果
問題 | No.58 イカサマなサイコロ |
ユーザー | threepipes_s |
提出日時 | 2015-12-30 01:50:44 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 111 ms |
コンパイル使用メモリ | 11,872 KB |
実行使用メモリ | 10,420 KB |
最終ジャッジ日時 | 2023-10-19 12:31:41 |
合計ジャッジ時間 | 7,706 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 1,165 ms
10,420 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | AC | 742 ms
10,420 KB |
testcase_05 | AC | 840 ms
10,420 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 528 ms
10,420 KB |
testcase_09 | AC | 1,050 ms
10,420 KB |
ソースコード
import random def win(n, k): n -= k sum = 0 for i in range(k): sum += random.randint(4, 6)-random.randint(1, 6) for i in range(n): sum += random.randint(1, 6)-random.randint(1, 6) return sum>0 n = int(input()) k = int(input()) trying = 100000 cnt = 0 for i in range(trying): if(win(n, k)): cnt += 1 print(cnt/trying)