結果

問題 No.220 世界のなんとか2
コンテスト
ユーザー ntuda
提出日時 2024-11-05 20:17:37
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 243 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 393 ms
コンパイル使用メモリ 85,168 KB
実行使用メモリ 53,556 KB
最終ジャッジ日時 2026-05-06 03:50:25
合計ジャッジ時間 2,865 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)
0