結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー あかりきあかりき
提出日時 2021-07-05 02:10:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 303 ms / 3,000 ms
コード長 495 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 95,364 KB
最終ジャッジ日時 2023-09-14 04:08:03
合計ジャッジ時間 6,618 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
76,508 KB
testcase_01 AC 79 ms
76,592 KB
testcase_02 AC 74 ms
76,700 KB
testcase_03 AC 69 ms
71,624 KB
testcase_04 AC 77 ms
76,008 KB
testcase_05 AC 75 ms
75,960 KB
testcase_06 AC 74 ms
75,952 KB
testcase_07 AC 73 ms
76,084 KB
testcase_08 AC 75 ms
76,580 KB
testcase_09 AC 75 ms
76,604 KB
testcase_10 AC 76 ms
76,660 KB
testcase_11 AC 73 ms
76,720 KB
testcase_12 AC 79 ms
76,356 KB
testcase_13 AC 81 ms
76,784 KB
testcase_14 AC 75 ms
76,596 KB
testcase_15 AC 83 ms
76,336 KB
testcase_16 AC 79 ms
76,764 KB
testcase_17 AC 77 ms
76,772 KB
testcase_18 AC 78 ms
76,760 KB
testcase_19 AC 82 ms
76,844 KB
testcase_20 AC 79 ms
76,744 KB
testcase_21 AC 84 ms
76,764 KB
testcase_22 AC 85 ms
76,584 KB
testcase_23 AC 87 ms
76,436 KB
testcase_24 AC 80 ms
76,544 KB
testcase_25 AC 83 ms
76,740 KB
testcase_26 AC 84 ms
76,744 KB
testcase_27 AC 84 ms
76,748 KB
testcase_28 AC 85 ms
76,768 KB
testcase_29 AC 78 ms
76,540 KB
testcase_30 AC 98 ms
76,516 KB
testcase_31 AC 88 ms
76,588 KB
testcase_32 AC 125 ms
81,216 KB
testcase_33 AC 163 ms
86,760 KB
testcase_34 AC 259 ms
94,844 KB
testcase_35 AC 264 ms
95,364 KB
testcase_36 AC 263 ms
95,084 KB
testcase_37 AC 303 ms
95,284 KB
testcase_38 AC 208 ms
95,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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

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