結果

問題 No.1731 Product of Subsequence
コンテスト
ユーザー irumo8202
提出日時 2022-01-29 13:15:40
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 270 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 64 ms
コンパイル使用メモリ 80,956 KB
実行使用メモリ 92,936 KB
最終ジャッジ日時 2026-10-10 03:01:06
合計ジャッジ時間 8,952 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 28 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

N, K, *A = map(int, open(0).read().split())
M = 1000000007

dp = {1: 1}
for a in A:
    for n, c in dp.copy().items():
        g = math.gcd(a * n, K)
        if g in dp:
            dp[g] += c
        else:
            dp[g] = c

print(dp[K] % M - (K == 1))
0