結果

問題 No.58 イカサマなサイコロ
ユーザー tobusakanatobusakana
提出日時 2022-11-05 15:27:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,979 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 80,076 KB
最終ジャッジ日時 2023-09-26 14:13:41
合計ジャッジ時間 55,984 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,975 ms
79,728 KB
testcase_01 AC 4,973 ms
79,372 KB
testcase_02 AC 4,979 ms
79,556 KB
testcase_03 AC 4,976 ms
78,788 KB
testcase_04 AC 4,973 ms
79,412 KB
testcase_05 AC 4,976 ms
79,772 KB
testcase_06 AC 4,975 ms
79,936 KB
testcase_07 AC 4,975 ms
79,444 KB
testcase_08 AC 4,974 ms
80,076 KB
testcase_09 AC 4,977 ms
79,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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