結果

問題 No.1417 100の倍数かつ正整数(2)
ユーザー あかりきあかりき
提出日時 2021-03-20 20:37:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 384 ms / 3,000 ms
コード長 576 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 94,464 KB
最終ジャッジ日時 2024-05-01 07:30:32
合計ジャッジ時間 4,961 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
60,032 KB
testcase_01 AC 48 ms
61,568 KB
testcase_02 AC 45 ms
60,636 KB
testcase_03 AC 39 ms
52,480 KB
testcase_04 AC 48 ms
60,928 KB
testcase_05 AC 43 ms
59,520 KB
testcase_06 AC 46 ms
60,928 KB
testcase_07 AC 48 ms
61,604 KB
testcase_08 AC 48 ms
61,568 KB
testcase_09 AC 48 ms
61,952 KB
testcase_10 AC 48 ms
61,696 KB
testcase_11 AC 44 ms
59,648 KB
testcase_12 AC 51 ms
62,976 KB
testcase_13 AC 56 ms
63,616 KB
testcase_14 AC 46 ms
60,160 KB
testcase_15 AC 56 ms
65,408 KB
testcase_16 AC 57 ms
65,792 KB
testcase_17 AC 53 ms
63,872 KB
testcase_18 AC 53 ms
63,488 KB
testcase_19 AC 56 ms
65,152 KB
testcase_20 AC 54 ms
64,256 KB
testcase_21 AC 59 ms
65,792 KB
testcase_22 AC 58 ms
66,560 KB
testcase_23 AC 59 ms
66,048 KB
testcase_24 AC 51 ms
62,848 KB
testcase_25 AC 58 ms
65,152 KB
testcase_26 AC 59 ms
66,048 KB
testcase_27 AC 58 ms
65,792 KB
testcase_28 AC 58 ms
65,792 KB
testcase_29 AC 53 ms
64,128 KB
testcase_30 AC 73 ms
73,728 KB
testcase_31 AC 58 ms
67,456 KB
testcase_32 AC 118 ms
80,512 KB
testcase_33 AC 155 ms
85,504 KB
testcase_34 AC 284 ms
93,720 KB
testcase_35 AC 289 ms
94,100 KB
testcase_36 AC 295 ms
94,164 KB
testcase_37 AC 384 ms
94,464 KB
testcase_38 AC 183 ms
93,972 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])
  if x!=0:
    for j in range(100):
      dp0[i][(j*x)%100]+=dp0[i-1][j]
      dp0[i][(j*x)%100]%=mod
    for j in range(100):
      for j2 in range(1,x):
        dp1[i][(j*j2)%100]+=dp0[i-1][j]
        dp1[i][(j*j2)%100]%=mod
  for j in range(100):
    for j2 in range(1,10):
      dp1[i][(j*j2)%100]+=dp1[i-1][j]
      dp1[i][(j*j2)%100]%=mod
  dp1[i][1]+=1
  dp1[i][1]%=mod

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