結果

問題 No.1407 Kindness
ユーザー ああいいああいい
提出日時 2022-03-12 16:14:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 325 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 83,920 KB
最終ジャッジ日時 2023-10-16 23:53:44
合計ジャッジ時間 4,509 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,560 KB
testcase_01 AC 37 ms
53,560 KB
testcase_02 AC 36 ms
53,560 KB
testcase_03 AC 36 ms
53,560 KB
testcase_04 AC 36 ms
53,560 KB
testcase_05 AC 35 ms
53,560 KB
testcase_06 AC 36 ms
53,560 KB
testcase_07 AC 37 ms
53,560 KB
testcase_08 AC 36 ms
53,560 KB
testcase_09 AC 36 ms
53,560 KB
testcase_10 AC 36 ms
53,560 KB
testcase_11 AC 36 ms
53,560 KB
testcase_12 AC 76 ms
82,980 KB
testcase_13 AC 51 ms
67,404 KB
testcase_14 AC 51 ms
67,960 KB
testcase_15 AC 62 ms
79,928 KB
testcase_16 AC 58 ms
74,232 KB
testcase_17 AC 54 ms
70,728 KB
testcase_18 AC 54 ms
70,676 KB
testcase_19 AC 62 ms
78,912 KB
testcase_20 AC 60 ms
77,472 KB
testcase_21 AC 49 ms
64,452 KB
testcase_22 AC 49 ms
64,440 KB
testcase_23 AC 60 ms
75,312 KB
testcase_24 AC 79 ms
83,920 KB
testcase_25 AC 53 ms
70,676 KB
testcase_26 AC 55 ms
74,104 KB
testcase_27 AC 48 ms
64,440 KB
testcase_28 AC 63 ms
79,744 KB
testcase_29 AC 47 ms
62,404 KB
testcase_30 AC 72 ms
81,640 KB
testcase_31 AC 50 ms
67,416 KB
testcase_32 AC 60 ms
78,964 KB
testcase_33 AC 51 ms
67,980 KB
testcase_34 AC 57 ms
74,820 KB
testcase_35 AC 50 ms
67,464 KB
testcase_36 AC 45 ms
62,380 KB
testcase_37 AC 64 ms
78,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
l = list(map(int,list(N)))
P = 10 ** 9 + 7
dp = [0] * len(l)
now = l[0]
for i in range(l[0]):
    dp[0] += i
for i in range(len(l)-1):
    dp[i+1] = dp[i] * 45 % P
    for j in range(l[i+1]):
        dp[i+1] += now * j
    for j in range(10):
        dp[i+1] += j
    now = now * l[i+1] % P
print((dp[-1]+now)%P)
0