結果
問題 | No.2188 整数列コイントスゲーム |
ユーザー |
👑 |
提出日時 | 2023-01-13 22:01:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 117 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 76,672 KB |
最終ジャッジ日時 | 2024-12-24 17:30:06 |
合計ジャッジ時間 | 7,087 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 47 |
ソースコード
n = int(input())m = int(input())if n == 0:print(1 - min(1, m))exit()A = [0]P = [1]for i in range(1, 300):P.append(P[-1])for j in range(i - 1, -1, -1):if j != 0:P[j] += P[j - 1]tot = sum(a * p for a, p in zip(A, P))A.append((pow(i, n) - tot) // P[-1])if m >= len(A):print(0)else:print(round(A[m]))