結果
| 問題 | No.58 イカサマなサイコロ |
| コンテスト | |
| ユーザー |
しらっ亭
|
| 提出日時 | 2015-08-22 12:14:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 4,566 ms / 5,000 ms |
| コード長 | 664 bytes |
| 記録 | |
| コンパイル時間 | 237 ms |
| コンパイル使用メモリ | 82,468 KB |
| 実行使用メモリ | 80,448 KB |
| 最終ジャッジ日時 | 2024-07-18 12:43:05 |
| 合計ジャッジ時間 | 50,995 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import random
import threading
from time import sleep
def solve():
N = int(input())
K = int(input())
stop_event = threading.Event()
def monte():
w = g = 0
while not stop_event.is_set():
x = y = 0
for j in range(N):
if j < K:
x += random.randint(4, 6)
else:
x += random.randint(1, 6)
y += random.randint(1, 6)
g += 1
if x > y:
w += 1
print(w / g)
threading.Thread(target=monte).start()
sleep(4.5)
stop_event.set()
if __name__ == '__main__':
solve()
しらっ亭