結果

問題 No.1731 Product of Subsequence
コンテスト
ユーザー ntuda
提出日時 2025-11-09 22:24:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 79,636 KB
最終ジャッジ日時 2025-11-09 22:24:42
合計ジャッジ時間 10,529 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 27 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 10 ** 9 + 7
from math import gcd,lcm
from collections import defaultdict
dic = defaultdict(int)

N,K = map(int,input().split())
A = list(map(int,input().split()))
dic[1] = 1
for a in A:
    for k,v in list(dic.items()):
        x = gcd(k*a,K)
        dic[x] += v
        dic[x] %= MOD
print(dic[K])
0