結果

問題 No.58 イカサマなサイコロ
コンテスト
ユーザー tobusakana
提出日時 2022-11-05 15:27:40
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 4,944 ms / 5,000 ms
+ 886µs
コード長 444 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 239 ms
コンパイル使用メモリ 96,236 KB
実行使用メモリ 86,144 KB
最終ジャッジ日時 2026-08-18 08:14:21
合計ジャッジ時間 56,233 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0