結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー AEnAEn
提出日時 2022-11-23 16:40:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,375 ms / 3,000 ms
コード長 793 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 81,432 KB
実行使用メモリ 114,204 KB
最終ジャッジ日時 2023-10-25 01:29:24
合計ジャッジ時間 12,283 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
66,236 KB
testcase_01 AC 79 ms
73,760 KB
testcase_02 AC 77 ms
72,972 KB
testcase_03 AC 48 ms
61,968 KB
testcase_04 AC 66 ms
68,936 KB
testcase_05 AC 69 ms
70,924 KB
testcase_06 AC 70 ms
70,940 KB
testcase_07 AC 74 ms
73,096 KB
testcase_08 AC 76 ms
73,068 KB
testcase_09 AC 76 ms
73,072 KB
testcase_10 AC 76 ms
73,120 KB
testcase_11 AC 64 ms
68,336 KB
testcase_12 AC 88 ms
75,972 KB
testcase_13 AC 89 ms
75,708 KB
testcase_14 AC 69 ms
70,916 KB
testcase_15 AC 105 ms
75,996 KB
testcase_16 AC 92 ms
75,972 KB
testcase_17 AC 95 ms
75,972 KB
testcase_18 AC 99 ms
76,236 KB
testcase_19 AC 102 ms
75,980 KB
testcase_20 AC 99 ms
76,292 KB
testcase_21 AC 97 ms
76,236 KB
testcase_22 AC 97 ms
75,972 KB
testcase_23 AC 101 ms
76,364 KB
testcase_24 AC 88 ms
75,972 KB
testcase_25 AC 101 ms
76,288 KB
testcase_26 AC 104 ms
76,072 KB
testcase_27 AC 101 ms
76,236 KB
testcase_28 AC 101 ms
76,292 KB
testcase_29 AC 102 ms
76,292 KB
testcase_30 AC 191 ms
79,040 KB
testcase_31 AC 155 ms
79,608 KB
testcase_32 AC 325 ms
84,000 KB
testcase_33 AC 551 ms
95,204 KB
testcase_34 AC 1,073 ms
112,836 KB
testcase_35 AC 1,100 ms
113,628 KB
testcase_36 AC 1,107 ms
113,628 KB
testcase_37 AC 1,375 ms
114,204 KB
testcase_38 AC 767 ms
113,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
mod = 10**9+7
NN = str(N)
L = len(NN)
# dp[i][j][k][l]:i桁目まで決めた時に,j:未満フラッグ,k:leading zero, l:mod100
dp = [[[[0]*100 for _ in range(2)] for _ in range(2)] for _ in range(L+1)]
dp[0][0][1][1] = 1
for i in range(L):
    D = int(NN[i])
    for less_f in range(2):
        for leading_f in range(2):
            for m in range(100):
                for d in range(10 if less_f else D+1):
                    # 正整数じゃなくなる
                    if leading_f==0 and d==0:continue
                    dp[i+1][less_f or (d<D)][leading_f and d==0][(m*d)%100 if d!=0 else m] += dp[i][less_f][leading_f][m]
                    dp[i+1][less_f or (d<D)][leading_f and d==0][(m*d)%100 if d!=0 else m] %= mod
print((dp[-1][0][0][0]+dp[-1][1][0][0])%mod)
0