結果

問題 No.1085 桁和の桁和
ユーザー nephrologistnephrologist
提出日時 2020-06-19 22:27:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 77,520 KB
最終ジャッジ日時 2023-09-30 06:17:42
合計ジャッジ時間 4,938 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,036 KB
testcase_01 AC 60 ms
71,108 KB
testcase_02 AC 58 ms
71,268 KB
testcase_03 AC 59 ms
71,212 KB
testcase_04 WA -
testcase_05 AC 58 ms
71,344 KB
testcase_06 AC 60 ms
71,336 KB
testcase_07 AC 57 ms
71,292 KB
testcase_08 AC 58 ms
71,148 KB
testcase_09 AC 59 ms
71,140 KB
testcase_10 AC 59 ms
71,000 KB
testcase_11 AC 67 ms
71,376 KB
testcase_12 WA -
testcase_13 AC 72 ms
76,624 KB
testcase_14 AC 76 ms
76,916 KB
testcase_15 AC 82 ms
77,072 KB
testcase_16 AC 83 ms
77,124 KB
testcase_17 AC 79 ms
77,200 KB
testcase_18 AC 77 ms
77,048 KB
testcase_19 AC 81 ms
76,976 KB
testcase_20 AC 77 ms
77,068 KB
testcase_21 AC 79 ms
77,088 KB
testcase_22 AC 79 ms
77,200 KB
testcase_23 AC 83 ms
76,572 KB
testcase_24 AC 75 ms
76,456 KB
testcase_25 AC 75 ms
77,368 KB
testcase_26 AC 79 ms
77,232 KB
testcase_27 AC 79 ms
77,292 KB
testcase_28 AC 80 ms
77,204 KB
testcase_29 AC 76 ms
76,952 KB
testcase_30 AC 75 ms
77,216 KB
testcase_31 AC 84 ms
77,208 KB
testcase_32 AC 80 ms
77,072 KB
testcase_33 AC 86 ms
77,204 KB
testcase_34 AC 89 ms
77,072 KB
testcase_35 AC 90 ms
76,988 KB
testcase_36 AC 89 ms
77,128 KB
testcase_37 AC 89 ms
77,284 KB
testcase_38 AC 89 ms
77,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = input()
D = int(input())
keta = len(t)

mod = 10 ** 9 + 7

hatena = 0
num = 0
for i in range(keta):
    if t[i] == "?":
        hatena += 1
    else:
        num += int(t[i])

if num == 0:
    num = 0
else:
    num = num % 9
    if num == 0:
        num += 9
cnt = [0] * (10)
cnt[num] += 1
if hatena == 0:
    print(cnt[D])
    exit()
for i in range(hatena):
    nxt = [0] * (10)
    ss = sum(cnt)
    for d in range(1, 10):
        nxt[d] += cnt[d]
        nxt[d] += ss
        nxt[d] %= mod
    cnt = nxt[::]
print(cnt[D] % mod)
0