結果

問題 No.1407 Kindness
ユーザー KudeKude
提出日時 2021-02-26 21:36:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 71,340 KB
最終ジャッジ日時 2024-04-10 12:11:01
合計ジャッジ時間 2,902 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,944 KB
testcase_01 AC 34 ms
52,660 KB
testcase_02 AC 36 ms
52,216 KB
testcase_03 AC 34 ms
52,316 KB
testcase_04 AC 35 ms
51,812 KB
testcase_05 AC 35 ms
52,332 KB
testcase_06 AC 36 ms
52,244 KB
testcase_07 AC 35 ms
52,128 KB
testcase_08 AC 34 ms
52,964 KB
testcase_09 AC 35 ms
51,876 KB
testcase_10 AC 38 ms
53,416 KB
testcase_11 AC 34 ms
53,660 KB
testcase_12 AC 45 ms
70,000 KB
testcase_13 AC 40 ms
62,032 KB
testcase_14 AC 41 ms
62,940 KB
testcase_15 AC 45 ms
68,536 KB
testcase_16 AC 43 ms
64,948 KB
testcase_17 AC 42 ms
62,812 KB
testcase_18 AC 41 ms
64,040 KB
testcase_19 AC 42 ms
68,212 KB
testcase_20 AC 43 ms
66,828 KB
testcase_21 AC 40 ms
59,784 KB
testcase_22 AC 40 ms
60,320 KB
testcase_23 AC 42 ms
66,036 KB
testcase_24 AC 46 ms
71,340 KB
testcase_25 AC 44 ms
63,196 KB
testcase_26 AC 44 ms
64,600 KB
testcase_27 AC 42 ms
60,724 KB
testcase_28 AC 46 ms
69,612 KB
testcase_29 AC 41 ms
60,024 KB
testcase_30 AC 47 ms
69,884 KB
testcase_31 AC 41 ms
61,572 KB
testcase_32 AC 43 ms
68,316 KB
testcase_33 AC 41 ms
62,864 KB
testcase_34 AC 43 ms
65,744 KB
testcase_35 AC 41 ms
62,452 KB
testcase_36 AC 39 ms
60,268 KB
testcase_37 AC 43 ms
71,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10 ** 9 + 7
n = input()
dp = [1, 0]
for i, d in enumerate(map(int, n)):
    dp = [
        d * dp[0] % MOD,
        (d * (d - 1) // 2 * dp[0] + 45 * dp[1] + (45 if i != 0 else 0)) % MOD
    ]
ans = sum(dp) % MOD
print(ans)
0