結果
| 問題 |
No.75 回数の期待値の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-29 21:22:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 4,055 ms / 5,000 ms |
| コード長 | 429 bytes |
| コンパイル時間 | 549 ms |
| コンパイル使用メモリ | 82,328 KB |
| 実行使用メモリ | 77,664 KB |
| 最終ジャッジ日時 | 2024-09-27 16:22:28 |
| 合計ジャッジ時間 | 86,862 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math,time,random
input = sys.stdin.readline
start = time.time()
K = int(input())
cnt = 0
S = 0
while time.time() - start < 4:
T = 0
tS = 0
while True:
T += random.randint(1,6)
tS += 1
if T>K:
T = 0
if T==K:
break
S += tS
cnt += 1
print(S/cnt)