結果

問題 No.1085 桁和の桁和
ユーザー tyawanmusityawanmusi
提出日時 2020-01-01 16:27:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 86,584 KB
実行使用メモリ 92,704 KB
最終ジャッジ日時 2023-09-30 06:00:26
合計ジャッジ時間 7,018 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,156 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 282 ms
92,040 KB
testcase_05 AC 63 ms
71,268 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 65 ms
71,052 KB
testcase_09 AC 64 ms
71,364 KB
testcase_10 AC 63 ms
71,336 KB
testcase_11 AC 61 ms
71,180 KB
testcase_12 AC 69 ms
76,360 KB
testcase_13 AC 86 ms
76,652 KB
testcase_14 AC 116 ms
79,876 KB
testcase_15 AC 167 ms
83,996 KB
testcase_16 AC 168 ms
84,164 KB
testcase_17 AC 118 ms
80,196 KB
testcase_18 AC 96 ms
76,724 KB
testcase_19 AC 161 ms
83,448 KB
testcase_20 WA -
testcase_21 AC 132 ms
80,940 KB
testcase_22 AC 150 ms
82,472 KB
testcase_23 AC 81 ms
76,616 KB
testcase_24 WA -
testcase_25 AC 120 ms
80,680 KB
testcase_26 AC 165 ms
84,356 KB
testcase_27 AC 152 ms
82,700 KB
testcase_28 AC 187 ms
85,384 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 165 ms
83,772 KB
testcase_32 AC 139 ms
81,512 KB
testcase_33 AC 276 ms
92,380 KB
testcase_34 AC 281 ms
92,704 KB
testcase_35 AC 285 ms
92,616 KB
testcase_36 AC 279 ms
92,632 KB
testcase_37 AC 275 ms
92,616 KB
testcase_38 AC 276 ms
92,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
d=int(input())
mod=10**9+7
digit_sum=0
blind_count=0
for i in range(len(s)):
  if s[i]=="?":
    blind_count+=1
  else:
    digit_sum+=int(s[i])
    while digit_sum>9:
      digit_sum-=9

dp=[10*[0]for _ in range(blind_count+1)]
dp[0][0]=1
for i in range(1,blind_count+1):
  for j in range(10):
    for k in range(10):
      jk=j+k
      if jk>9:
        jk-=9
      dp[i][jk]+=dp[i-1][j]
      dp[i][jk]%=mod

print(dp[blind_count][d])
0