結果
| 問題 |
No.220 世界のなんとか2
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-11-05 20:17:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 1,000 ms |
| コード長 | 243 bytes |
| コンパイル時間 | 462 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 53,868 KB |
| 最終ジャッジ日時 | 2024-11-05 20:17:40 |
| 合計ジャッジ時間 | 2,458 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
from math import comb
P = int(input())
ans = 0
Y = [0] * (P + 1)
for x in range(1, P + 1):
cnt = (pow(10, x) - 1) // 3
for i in range(1, x):
cnt += comb(x, i) * Y[x - i]
ans = cnt
Y[x] = pow(10, x) - cnt - 1
print(ans)
ntuda