結果
| 問題 | No.3716 Keep it Integer |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-08-22 00:22:55 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 171 ms / 2,000 ms |
| + 331µs | |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 74 ms |
| コンパイル使用メモリ | 80,384 KB |
| 実行使用メモリ | 107,008 KB |
| 最終ジャッジ日時 | 2026-09-18 20:50:21 |
| 合計ジャッジ時間 | 9,680 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 50 |
ソースコード
from collections import defaultdict
MOD = 998244353
N, X = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
dp = defaultdict(int)
dp[X] = 1
for a in A:
ndp = defaultdict(int)
total = sum(dp.values()) % MOD
ndp[a] += total
ndp[a] %= MOD
for key in dp.keys():
if key % a == 0:
ndp[key // a] += dp[key]
ndp[key // a] %= MOD
dp = ndp
print(sum(dp.values()) % MOD)