結果
問題 |
No.2188 整数列コイントスゲーム
|
ユーザー |
|
提出日時 | 2023-01-13 21:59:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 417 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-12-24 17:28:00 |
合計ジャッジ時間 | 4,335 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 WA * 4 |
ソースコード
n = int(input()) m = int(input()) if n == 0: print(1 - min(1, m)) exit() A = [0] P = [1] div = 1 for i in range(1, 30): P.append(P[-1] / 2) for j in range(i - 1, -1, -1): P[j] /= 2 if j != 0: P[j] += P[j - 1] / 2 div /= 2 tot = sum(a * p for a, p in zip(A, P)) A.append((div * pow(i, n) - tot) / P[-1]) if m >= len(A): print(0) else: print(round(A[m]))