結果

問題 No.1085 桁和の桁和
ユーザー tanon710tanon710
提出日時 2020-06-19 23:16:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 76,568 KB
最終ジャッジ日時 2023-08-06 14:34:15
合計ジャッジ時間 5,566 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,252 KB
testcase_01 AC 75 ms
71,316 KB
testcase_02 AC 74 ms
71,184 KB
testcase_03 AC 75 ms
71,364 KB
testcase_04 AC 79 ms
75,432 KB
testcase_05 AC 75 ms
71,172 KB
testcase_06 AC 74 ms
71,528 KB
testcase_07 AC 75 ms
71,236 KB
testcase_08 AC 74 ms
71,180 KB
testcase_09 AC 76 ms
71,248 KB
testcase_10 AC 75 ms
71,348 KB
testcase_11 AC 76 ms
71,212 KB
testcase_12 AC 75 ms
71,212 KB
testcase_13 AC 84 ms
76,368 KB
testcase_14 AC 87 ms
76,072 KB
testcase_15 AC 100 ms
76,456 KB
testcase_16 AC 100 ms
76,460 KB
testcase_17 AC 89 ms
76,500 KB
testcase_18 AC 85 ms
76,280 KB
testcase_19 AC 97 ms
76,344 KB
testcase_20 AC 81 ms
75,800 KB
testcase_21 AC 91 ms
76,316 KB
testcase_22 AC 97 ms
76,076 KB
testcase_23 AC 83 ms
76,488 KB
testcase_24 AC 75 ms
71,260 KB
testcase_25 AC 91 ms
76,416 KB
testcase_26 AC 102 ms
76,412 KB
testcase_27 AC 97 ms
76,532 KB
testcase_28 AC 102 ms
76,392 KB
testcase_29 AC 92 ms
76,116 KB
testcase_30 AC 94 ms
76,276 KB
testcase_31 AC 99 ms
76,272 KB
testcase_32 AC 93 ms
76,568 KB
testcase_33 AC 123 ms
76,416 KB
testcase_34 AC 123 ms
76,508 KB
testcase_35 AC 122 ms
76,308 KB
testcase_36 AC 122 ms
76,532 KB
testcase_37 AC 122 ms
76,280 KB
testcase_38 AC 123 ms
76,532 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
    else:
        tmp%=9
    coef=0
    for i in range(cnt):
        coef+=pow(10,i,mod)
        coef%=mod
    if tmp==0:
        ans=coef
    elif tmp==d:
        ans=coef+1
    else:
        ans=coef
    print(ans%mod)
if d==0:
    if tmp!=0:
        print(0)
    else:
        print(1)
0