結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
60,108 KB
testcase_01 AC 50 ms
63,320 KB
testcase_02 AC 45 ms
60,516 KB
testcase_03 AC 38 ms
53,060 KB
testcase_04 AC 44 ms
59,788 KB
testcase_05 AC 42 ms
59,428 KB
testcase_06 AC 44 ms
59,876 KB
testcase_07 AC 43 ms
60,192 KB
testcase_08 AC 45 ms
61,396 KB
testcase_09 AC 45 ms
61,384 KB
testcase_10 AC 46 ms
61,392 KB
testcase_11 AC 41 ms
60,072 KB
testcase_12 AC 48 ms
63,920 KB
testcase_13 AC 50 ms
64,636 KB
testcase_14 AC 44 ms
61,088 KB
testcase_15 AC 53 ms
64,344 KB
testcase_16 AC 50 ms
63,308 KB
testcase_17 AC 47 ms
63,288 KB
testcase_18 AC 47 ms
62,356 KB
testcase_19 AC 51 ms
63,804 KB
testcase_20 AC 48 ms
63,644 KB
testcase_21 AC 53 ms
65,032 KB
testcase_22 AC 53 ms
65,148 KB
testcase_23 AC 49 ms
65,164 KB
testcase_24 AC 44 ms
61,308 KB
testcase_25 AC 50 ms
64,324 KB
testcase_26 AC 51 ms
64,424 KB
testcase_27 AC 53 ms
64,932 KB
testcase_28 AC 54 ms
65,684 KB
testcase_29 AC 48 ms
63,764 KB
testcase_30 AC 65 ms
71,704 KB
testcase_31 AC 58 ms
68,256 KB
testcase_32 AC 99 ms
79,864 KB
testcase_33 AC 137 ms
85,332 KB
testcase_34 AC 230 ms
93,660 KB
testcase_35 AC 232 ms
93,980 KB
testcase_36 AC 238 ms
94,180 KB
testcase_37 AC 273 ms
94,376 KB
testcase_38 AC 174 ms
93,852 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