結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー NatsubiSoganNatsubiSogan
提出日時 2021-03-06 17:04:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 507 ms / 3,000 ms
コード長 590 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 163,968 KB
最終ジャッジ日時 2024-04-17 05:33:34
合計ジャッジ時間 6,696 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
60,032 KB
testcase_01 AC 64 ms
64,000 KB
testcase_02 AC 63 ms
62,208 KB
testcase_03 AC 43 ms
52,480 KB
testcase_04 AC 50 ms
59,904 KB
testcase_05 AC 56 ms
61,312 KB
testcase_06 AC 57 ms
60,928 KB
testcase_07 AC 54 ms
59,776 KB
testcase_08 AC 58 ms
62,336 KB
testcase_09 AC 60 ms
62,848 KB
testcase_10 AC 55 ms
60,928 KB
testcase_11 AC 54 ms
60,032 KB
testcase_12 AC 67 ms
64,640 KB
testcase_13 AC 69 ms
65,792 KB
testcase_14 AC 54 ms
61,056 KB
testcase_15 AC 79 ms
70,016 KB
testcase_16 AC 70 ms
65,920 KB
testcase_17 AC 68 ms
64,768 KB
testcase_18 AC 70 ms
65,408 KB
testcase_19 AC 72 ms
66,304 KB
testcase_20 AC 63 ms
63,616 KB
testcase_21 AC 70 ms
66,176 KB
testcase_22 AC 71 ms
67,328 KB
testcase_23 AC 73 ms
67,200 KB
testcase_24 AC 62 ms
63,744 KB
testcase_25 AC 72 ms
67,328 KB
testcase_26 AC 71 ms
66,688 KB
testcase_27 AC 71 ms
66,560 KB
testcase_28 AC 71 ms
66,560 KB
testcase_29 AC 63 ms
63,872 KB
testcase_30 AC 115 ms
82,432 KB
testcase_31 AC 108 ms
84,480 KB
testcase_32 AC 164 ms
89,984 KB
testcase_33 AC 277 ms
120,320 KB
testcase_34 AC 476 ms
161,536 KB
testcase_35 AC 493 ms
163,968 KB
testcase_36 AC 495 ms
163,584 KB
testcase_37 AC 507 ms
163,968 KB
testcase_38 AC 438 ms
163,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10 ** 9 + 7
s = input()
n = len(s)
dp = [[[0] * 2 for i in range(100)] for j in range(n + 1)]
dp[0][1][1] = 1
for i in range(n):
    x = int(s[i])
    for j in range(100):
        for k in range(1, 10):
            if k < x:
                dp[i + 1][j * k % 100][0] += dp[i][j][1]
            if k == x:
                dp[i + 1][j * k % 100][1] += dp[i][j][1]
            dp[i + 1][j * k % 100][0] += dp[i][j][0]
            dp[i + 1][j * k % 100][0] %= mod
            dp[i + 1][j * k % 100][1] %= mod
    dp[i + 1][1][0] += 1
    dp[i + 1][1][0] %= mod
print(sum(dp[-1][0]) % mod)
0