結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー trineutrontrineutron
提出日時 2021-03-05 22:53:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 686 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 45,824 KB
最終ジャッジ日時 2024-04-16 10:46:28
合計ジャッジ時間 12,533 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
15,872 KB
testcase_01 AC 34 ms
10,496 KB
testcase_02 AC 81 ms
10,880 KB
testcase_03 AC 34 ms
10,496 KB
testcase_04 AC 32 ms
10,496 KB
testcase_05 AC 34 ms
10,496 KB
testcase_06 AC 34 ms
10,496 KB
testcase_07 AC 34 ms
10,624 KB
testcase_08 AC 33 ms
10,368 KB
testcase_09 AC 33 ms
10,368 KB
testcase_10 AC 33 ms
10,624 KB
testcase_11 AC 34 ms
10,496 KB
testcase_12 AC 43 ms
10,624 KB
testcase_13 AC 44 ms
10,624 KB
testcase_14 AC 47 ms
10,752 KB
testcase_15 AC 57 ms
10,496 KB
testcase_16 AC 60 ms
10,624 KB
testcase_17 AC 60 ms
10,624 KB
testcase_18 AC 75 ms
10,880 KB
testcase_19 AC 69 ms
10,880 KB
testcase_20 AC 78 ms
10,880 KB
testcase_21 AC 84 ms
10,624 KB
testcase_22 AC 90 ms
11,008 KB
testcase_23 AC 89 ms
10,752 KB
testcase_24 AC 80 ms
10,880 KB
testcase_25 AC 94 ms
10,880 KB
testcase_26 AC 87 ms
10,880 KB
testcase_27 AC 88 ms
11,008 KB
testcase_28 AC 88 ms
10,880 KB
testcase_29 AC 99 ms
11,008 KB
testcase_30 AC 536 ms
13,824 KB
testcase_31 AC 553 ms
14,464 KB
testcase_32 AC 1,246 ms
18,560 KB
testcase_33 AC 2,878 ms
31,104 KB
testcase_34 TLE -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7

n = input()
l = len(n)
dp0 = [[0] * 100 for i in range(l + 1)]
dp1 = [[0] * 100 for i in range(l + 1)]
for i in range(l):
    d = ord(n[i]) - ord('0')
    for j in range(100):
        dp0[i][j] %= mod
        dp1[i][j] %= mod
        for k in range(1, 10):
            newj = j * k % 100
            dp1[i + 1][newj] += dp1[i][j]
            if k == d:
                dp0[i + 1][newj] += dp0[i][j]
            if k < d:
                dp1[i + 1][newj] += dp0[i][j]
            if j:
                continue
            if i or k < d:
                dp1[i + 1][k] += 1
            elif k == d:
                dp0[i + 1][k] += 1
print((dp0[l][0] + dp1[l][0]) % mod)
0