結果
| 問題 |
No.58 イカサマなサイコロ
|
| ユーザー |
|
| 提出日時 | 2022-11-05 15:27:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 4,942 ms / 5,000 ms |
| コード長 | 444 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 78,464 KB |
| 最終ジャッジ日時 | 2024-07-19 08:28:56 |
| 合計ジャッジ時間 | 55,122 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
N = int(input())
K = int(input())
import time
start = time.time()
edited = [4,5,6]
normal = [1,2,3,4,5,6]
import random
def play(X):
point = 0
L = len(X) - 1
for i in range(K):
point += X[random.randint(0, L)]
for i in range(K, N):
point += normal[random.randint(0, 5)]
return point
win = 0
played = 0
while time.time() - start < 4.9:
played += 1
if play(edited) > play(normal):
win += 1
print(win / played)