結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-03-06 10:49:11
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 442 ms / 3,000 ms
コード長 551 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 165,312 KB
最終ジャッジ日時 2023-07-29 17:35:48
合計ジャッジ時間 7,546 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
76,460 KB
testcase_01 AC 74 ms
76,496 KB
testcase_02 AC 72 ms
76,576 KB
testcase_03 AC 67 ms
71,340 KB
testcase_04 AC 68 ms
76,096 KB
testcase_05 AC 70 ms
76,096 KB
testcase_06 AC 70 ms
76,200 KB
testcase_07 AC 69 ms
76,088 KB
testcase_08 AC 75 ms
76,564 KB
testcase_09 AC 74 ms
76,196 KB
testcase_10 AC 72 ms
76,196 KB
testcase_11 AC 70 ms
76,604 KB
testcase_12 AC 77 ms
76,684 KB
testcase_13 AC 79 ms
76,680 KB
testcase_14 AC 71 ms
76,316 KB
testcase_15 AC 87 ms
77,280 KB
testcase_16 AC 79 ms
76,784 KB
testcase_17 AC 77 ms
76,644 KB
testcase_18 AC 76 ms
76,708 KB
testcase_19 AC 79 ms
76,732 KB
testcase_20 AC 74 ms
76,620 KB
testcase_21 AC 79 ms
76,488 KB
testcase_22 AC 80 ms
76,280 KB
testcase_23 AC 79 ms
76,736 KB
testcase_24 AC 76 ms
76,608 KB
testcase_25 AC 80 ms
76,684 KB
testcase_26 AC 84 ms
76,556 KB
testcase_27 AC 82 ms
76,724 KB
testcase_28 AC 80 ms
76,832 KB
testcase_29 AC 74 ms
76,612 KB
testcase_30 AC 105 ms
84,124 KB
testcase_31 AC 105 ms
86,188 KB
testcase_32 AC 153 ms
94,976 KB
testcase_33 AC 250 ms
121,244 KB
testcase_34 AC 413 ms
163,128 KB
testcase_35 AC 418 ms
165,228 KB
testcase_36 AC 434 ms
165,312 KB
testcase_37 AC 442 ms
165,272 KB
testcase_38 AC 378 ms
165,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
mod = 10**9+7
le = len(n)
dp = [[[0]*2 for i in range(100)] for j in range(le+1)]
dp[0][1][1] = 1

for i in range(le):
    x = int(n[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][1] %= mod
            dp[i+1][(j*k)%100][0] += dp[i][j][0]
            dp[i+1][(j*k)%100][0] %= mod
    dp[i+1][1][0] += 1
print(sum(dp[-1][0])%mod)
            
0