結果

問題 No.1085 桁和の桁和
ユーザー c-yanc-yan
提出日時 2020-06-21 01:27:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 385 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,840 KB
実行使用メモリ 8,416 KB
最終ジャッジ日時 2023-09-30 06:31:24
合計ジャッジ時間 29,447 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,916 KB
testcase_01 AC 15 ms
7,780 KB
testcase_02 AC 16 ms
7,784 KB
testcase_03 AC 17 ms
7,992 KB
testcase_04 AC 1,994 ms
8,256 KB
testcase_05 AC 16 ms
7,804 KB
testcase_06 AC 16 ms
7,884 KB
testcase_07 AC 16 ms
7,852 KB
testcase_08 AC 16 ms
7,852 KB
testcase_09 AC 16 ms
7,844 KB
testcase_10 AC 16 ms
7,828 KB
testcase_11 AC 16 ms
7,812 KB
testcase_12 AC 16 ms
7,872 KB
testcase_13 AC 149 ms
7,824 KB
testcase_14 AC 448 ms
8,220 KB
testcase_15 AC 1,003 ms
8,340 KB
testcase_16 AC 999 ms
8,228 KB
testcase_17 AC 473 ms
8,252 KB
testcase_18 AC 257 ms
7,780 KB
testcase_19 AC 895 ms
8,252 KB
testcase_20 AC 907 ms
8,272 KB
testcase_21 AC 589 ms
8,268 KB
testcase_22 AC 833 ms
8,328 KB
testcase_23 AC 87 ms
7,940 KB
testcase_24 AC 25 ms
7,792 KB
testcase_25 AC 517 ms
8,240 KB
testcase_26 AC 1,049 ms
8,236 KB
testcase_27 AC 826 ms
8,260 KB
testcase_28 AC 1,175 ms
8,344 KB
testcase_29 AC 626 ms
8,368 KB
testcase_30 AC 565 ms
8,312 KB
testcase_31 AC 998 ms
8,328 KB
testcase_32 AC 686 ms
8,284 KB
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = input()
D = int(input())

m = 1000000007


def update(t, nt, v):
    for i in range(10):
        ni = i + v
        if ni > 9:
            ni -= 9
        nt[ni] += t[i]
        nt[ni] %= m


t = [0] * 10
t[0] = 1
for c in T:
    nt = [0] * 10
    if c != '?':
        update(t, nt, int(c))
    else:
        for i in range(10):
            update(t, nt, i)
    t = nt
print(t[D])
0