結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー あかりきあかりき
提出日時 2021-03-20 20:47:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 3,000 ms
コード長 475 bytes
コンパイル時間 977 ms
コンパイル使用メモリ 86,788 KB
実行使用メモリ 95,268 KB
最終ジャッジ日時 2023-08-13 14:43:51
合計ジャッジ時間 6,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,460 KB
testcase_01 AC 82 ms
76,500 KB
testcase_02 AC 79 ms
76,324 KB
testcase_03 AC 72 ms
71,248 KB
testcase_04 AC 77 ms
75,788 KB
testcase_05 AC 76 ms
75,684 KB
testcase_06 AC 78 ms
75,980 KB
testcase_07 AC 78 ms
75,996 KB
testcase_08 AC 80 ms
76,680 KB
testcase_09 AC 81 ms
76,332 KB
testcase_10 AC 81 ms
76,336 KB
testcase_11 AC 77 ms
76,576 KB
testcase_12 AC 83 ms
76,580 KB
testcase_13 AC 84 ms
76,440 KB
testcase_14 AC 78 ms
76,156 KB
testcase_15 AC 87 ms
76,640 KB
testcase_16 AC 84 ms
76,568 KB
testcase_17 AC 82 ms
76,612 KB
testcase_18 AC 84 ms
76,560 KB
testcase_19 AC 87 ms
76,680 KB
testcase_20 AC 83 ms
76,588 KB
testcase_21 AC 86 ms
76,616 KB
testcase_22 AC 88 ms
76,376 KB
testcase_23 AC 87 ms
76,540 KB
testcase_24 AC 81 ms
76,588 KB
testcase_25 AC 86 ms
76,580 KB
testcase_26 AC 87 ms
76,740 KB
testcase_27 AC 88 ms
76,424 KB
testcase_28 AC 90 ms
76,604 KB
testcase_29 AC 85 ms
76,568 KB
testcase_30 AC 99 ms
76,336 KB
testcase_31 AC 91 ms
76,512 KB
testcase_32 AC 127 ms
80,736 KB
testcase_33 AC 165 ms
86,388 KB
testcase_34 AC 259 ms
94,856 KB
testcase_35 AC 265 ms
95,132 KB
testcase_36 AC 263 ms
95,268 KB
testcase_37 AC 305 ms
95,044 KB
testcase_38 AC 204 ms
94,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=list(input())
mod=10**9+7

dp0=[[0]*100 for i in range(len(n)+1)]
dp1=[[0]*100 for i in range(len(n)+1)]
dp0[0][1]=1

for i in range(1,len(n)+1):
  x=int(n[i-1])
  for j in range(100):
    if x!=0:
      dp0[i][(j*x)%100]+=dp0[i-1][j]
      for j2 in range(1,x):
        dp1[i][(j*j2)%100]+=dp0[i-1][j]
    for j2 in range(1,10):
      dp1[i][(j*j2)%100]+=dp1[i-1][j]
    dp0[i][j]%=mod
    dp1[i][j]%=mod
  dp1[i][1]+=1
  dp1[i][1]%=mod

print((dp0[-1][0]+dp1[-1][0])%mod)
0