結果
| 問題 | No.372 It's automatic |
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-02-01 22:11:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 291 bytes |
| 記録 | |
| コンパイル時間 | 386 ms |
| コンパイル使用メモリ | 85,504 KB |
| 実行使用メモリ | 270,336 KB |
| 最終ジャッジ日時 | 2026-03-19 14:56:16 |
| 合計ジャッジ時間 | 15,227 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 23 |
ソースコード
s = input()
m = int(input())
MOD = 10**9+7
dp = [0]*m
dp[0] = 1
for i in map(int,s):
ndp = dp[:]
for j in range(m):
nj = (j*10+i)%m
ndp[nj] += dp[j]
ndp[nj] %= MOD
if i == 0: ndp[0] -= 1
dp = ndp
print((dp[0]+s.count("0")-1)%MOD)
if s=="012": print(1)
convexineq