結果
| 問題 | No.1085 桁和の桁和 |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2020-06-19 22:41:41 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 580 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 21,756 KB |
| 最終ジャッジ日時 | 2026-04-03 11:47:32 |
| 合計ジャッジ時間 | 6,642 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 24 WA * 4 TLE * 7 |
ソースコード
T=input()
D=int(input())
mod=10**9+7
Q=0
W=0
for t in T:
if t=="?":
Q+=1
else:
W+=int(t)
DP=[0]*9
DP[W%9]=1
for t in range(Q):
NDP=[0]*9
for i in range(9):
for j in range(9):
if i==j:
NDP[i]+=DP[i]*2
else:
NDP[j]+=DP[i]
NDP[j]%=mod
DP=NDP
print(DP[D%9])
titia