結果

問題 No.1085 桁和の桁和
ユーザー tanon710tanon710
提出日時 2020-06-19 23:14:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 1,417 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2023-09-30 06:27:57
合計ジャッジ時間 5,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
70,908 KB
testcase_01 AC 65 ms
71,348 KB
testcase_02 AC 62 ms
71,144 KB
testcase_03 AC 65 ms
71,120 KB
testcase_04 AC 71 ms
75,512 KB
testcase_05 AC 62 ms
71,208 KB
testcase_06 AC 63 ms
71,148 KB
testcase_07 AC 66 ms
71,296 KB
testcase_08 AC 65 ms
71,384 KB
testcase_09 AC 69 ms
71,092 KB
testcase_10 AC 64 ms
71,336 KB
testcase_11 AC 68 ms
70,940 KB
testcase_12 AC 73 ms
71,356 KB
testcase_13 AC 80 ms
76,464 KB
testcase_14 AC 80 ms
76,480 KB
testcase_15 AC 89 ms
76,520 KB
testcase_16 AC 86 ms
76,380 KB
testcase_17 AC 80 ms
76,628 KB
testcase_18 AC 74 ms
76,372 KB
testcase_19 AC 83 ms
76,140 KB
testcase_20 AC 73 ms
76,288 KB
testcase_21 AC 78 ms
76,516 KB
testcase_22 AC 83 ms
76,400 KB
testcase_23 AC 71 ms
76,536 KB
testcase_24 WA -
testcase_25 AC 76 ms
76,428 KB
testcase_26 AC 84 ms
76,336 KB
testcase_27 AC 84 ms
76,608 KB
testcase_28 AC 90 ms
76,340 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 89 ms
76,088 KB
testcase_32 AC 86 ms
76,296 KB
testcase_33 AC 110 ms
76,328 KB
testcase_34 AC 108 ms
76,444 KB
testcase_35 AC 107 ms
76,472 KB
testcase_36 AC 108 ms
76,468 KB
testcase_37 AC 111 ms
76,520 KB
testcase_38 AC 116 ms
76,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
t=input()
d=int(input())
tmp=0
cnt=0
for c in t:
    if c=='?':
        cnt+=1
    else:
        tmp+=int(c)
if d!=0:
    if tmp!=0 and tmp%9==0:
        tmp=9
    coef=0
    for i in range(cnt):
        coef+=pow(10,i,mod)
        coef%=mod
    coef=[1]+[coef]*9
    if tmp==0:
        ans=coef[d]
    elif tmp==d:
        ans=coef[0]+coef[9]
    else:
        ans=coef[(d-tmp)%9]
    print(ans%mod)
if d==0:
    if tmp!=0:
        print(0)
    else:
        print(1)
0