結果
| 問題 | No.1085 桁和の桁和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-19 23:16:41 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 43 ms / 2,000 ms |
| + 854µs | |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 75 ms |
| コンパイル使用メモリ | 80,640 KB |
| 実行使用メモリ | 68,736 KB |
| 最終ジャッジ日時 | 2026-09-19 19:11:05 |
| 合計ジャッジ時間 | 3,472 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 35 |
ソースコード
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)