結果

問題 No.1731 Product of Subsequence
ユーザー とりゐ
提出日時 2021-08-23 08:45:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,300 KB
実行使用メモリ 88,784 KB
最終ジャッジ日時 2024-11-06 11:48:51
合計ジャッジ時間 12,764 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(map(int,input().split()))
from math import*
from collections import*
d=defaultdict(int)
d[1]=1
for i in a:
  d2=d.copy()
  for j in d2:
    d[gcd(k,i*j)]+=d2[j]
print(d[k]-(k==1))
0