結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
59,392 KB
testcase_01 AC 48 ms
61,696 KB
testcase_02 AC 47 ms
61,312 KB
testcase_03 AC 38 ms
52,352 KB
testcase_04 AC 45 ms
59,648 KB
testcase_05 AC 45 ms
59,008 KB
testcase_06 AC 46 ms
59,904 KB
testcase_07 AC 46 ms
59,776 KB
testcase_08 AC 48 ms
60,672 KB
testcase_09 AC 46 ms
61,440 KB
testcase_10 AC 46 ms
61,056 KB
testcase_11 AC 44 ms
59,520 KB
testcase_12 AC 52 ms
62,976 KB
testcase_13 AC 52 ms
63,232 KB
testcase_14 AC 45 ms
60,672 KB
testcase_15 AC 56 ms
64,512 KB
testcase_16 AC 53 ms
63,616 KB
testcase_17 AC 50 ms
62,848 KB
testcase_18 AC 51 ms
62,788 KB
testcase_19 AC 57 ms
64,384 KB
testcase_20 AC 50 ms
62,720 KB
testcase_21 AC 55 ms
64,896 KB
testcase_22 AC 55 ms
65,152 KB
testcase_23 AC 55 ms
64,000 KB
testcase_24 AC 48 ms
61,568 KB
testcase_25 AC 53 ms
64,384 KB
testcase_26 AC 55 ms
65,280 KB
testcase_27 AC 56 ms
65,536 KB
testcase_28 AC 57 ms
65,664 KB
testcase_29 AC 52 ms
63,616 KB
testcase_30 AC 71 ms
72,704 KB
testcase_31 AC 61 ms
68,632 KB
testcase_32 AC 105 ms
80,368 KB
testcase_33 AC 142 ms
85,084 KB
testcase_34 AC 236 ms
93,772 KB
testcase_35 AC 242 ms
94,464 KB
testcase_36 AC 241 ms
94,244 KB
testcase_37 AC 285 ms
94,080 KB
testcase_38 AC 179 ms
94,120 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]
  for j in range(100):
    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