結果
問題 | No.1085 桁和の桁和 |
ユーザー |
|
提出日時 | 2020-06-19 23:16:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 647 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 66,816 KB |
最終ジャッジ日時 | 2024-11-06 17:39:58 |
合計ジャッジ時間 | 3,900 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 35 |
ソースコード
mod=10**9+7t=input()d=int(input())tmp=0cnt=0for c in t:if c=='?':cnt+=1else:tmp+=int(c)if d!=0:if tmp!=0 and tmp%9==0:tmp=9else:tmp%=9coef=0for i in range(cnt):coef+=pow(10,i,mod)coef%=modif tmp==0:ans=coefelif tmp==d:ans=coef+1else:ans=coefprint(ans%mod)if d==0:if tmp!=0:print(0)else:print(1)