結果

問題 No.1407 Kindness
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-02-26 22:18:18
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 1,029 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 77,280 KB
最終ジャッジ日時 2023-07-25 21:44:29
合計ジャッジ時間 5,867 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,080 KB
testcase_01 AC 73 ms
71,280 KB
testcase_02 AC 75 ms
71,144 KB
testcase_03 AC 73 ms
71,064 KB
testcase_04 AC 73 ms
71,024 KB
testcase_05 AC 74 ms
71,012 KB
testcase_06 AC 74 ms
71,168 KB
testcase_07 AC 74 ms
71,204 KB
testcase_08 AC 74 ms
71,172 KB
testcase_09 AC 75 ms
71,124 KB
testcase_10 AC 76 ms
71,008 KB
testcase_11 AC 78 ms
71,176 KB
testcase_12 AC 89 ms
77,184 KB
testcase_13 AC 83 ms
76,400 KB
testcase_14 AC 83 ms
76,612 KB
testcase_15 AC 87 ms
77,060 KB
testcase_16 AC 89 ms
76,892 KB
testcase_17 AC 86 ms
76,944 KB
testcase_18 AC 85 ms
76,528 KB
testcase_19 AC 87 ms
76,848 KB
testcase_20 AC 86 ms
76,960 KB
testcase_21 AC 83 ms
76,476 KB
testcase_22 AC 85 ms
76,412 KB
testcase_23 AC 88 ms
76,632 KB
testcase_24 AC 89 ms
77,120 KB
testcase_25 AC 86 ms
76,808 KB
testcase_26 AC 84 ms
77,116 KB
testcase_27 AC 84 ms
76,484 KB
testcase_28 AC 88 ms
77,280 KB
testcase_29 AC 83 ms
76,624 KB
testcase_30 AC 88 ms
76,864 KB
testcase_31 AC 86 ms
76,800 KB
testcase_32 AC 87 ms
77,164 KB
testcase_33 AC 85 ms
76,716 KB
testcase_34 AC 87 ms
76,956 KB
testcase_35 AC 84 ms
76,624 KB
testcase_36 AC 82 ms
76,412 KB
testcase_37 AC 88 ms
77,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
mod = 10**9+7

dp = [[0]*2 for i in range(len(n)+1)]
dp[0][0] = 1
for i in range(len(n)):
    s = int(n[i])
    dp[i+1][0] = dp[i][0]*s%mod
    dp[i+1][1] += (dp[i][1]*45+1)%mod
    dp[i+1][1] += s*(s-1)//2*dp[i][0]%mod
    dp[i+1][1] %= mod
print((sum(dp[-1])-1)%mod)
0