結果

問題 No.3716 Keep it Integer
コンテスト
ユーザー 回転
提出日時 2026-09-19 00:01:59
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 145 ms / 2,000 ms
+ 591µs
コード長 258 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 70 ms
コンパイル使用メモリ 80,384 KB
実行使用メモリ 111,872 KB
最終ジャッジ日時 2026-09-19 00:02:08
合計ジャッジ時間 9,137 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import*
M=998244353
N,X=map(int,input().split())
A=map(int,input().split())
d=defaultdict(int);d[X]=1
for a in A:
 n=defaultdict(int)
 for j in d:
  n[a]=(n[a]+d[j])%M
  if j%a==0:n[j//a]=(n[j//a]+d[j])%M
 d,n = n,d
print(sum(d.values())%M)
0