結果

問題 No.1407 Kindness
ユーザー c-yan
提出日時 2021-02-27 00:55:46
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-02 16:44:48
合計ジャッジ時間 3,171 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

m = 1000000007

N = input()

lut = list(accumulate(range(10)))
result = lut[int(N[-1])]
b = 45
for c in map(int, N[:-1][::-1]):
    if c != 0:
        result = c * result + lut[c - 1] * b + b
        result %= m
    b *= 45
    b %= m
print(result)
0