結果

問題 No.1731 Product of Subsequence
ユーザー tassei903tassei903
提出日時 2021-11-06 10:05:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 758 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 85,248 KB
最終ジャッジ日時 2024-04-24 20:00:28
合計ジャッジ時間 14,531 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,139 ms
84,352 KB
testcase_01 AC 41 ms
53,888 KB
testcase_02 AC 40 ms
53,888 KB
testcase_03 AC 43 ms
54,400 KB
testcase_04 AC 42 ms
54,016 KB
testcase_05 AC 54 ms
63,360 KB
testcase_06 AC 56 ms
63,232 KB
testcase_07 AC 43 ms
53,888 KB
testcase_08 AC 105 ms
76,544 KB
testcase_09 WA -
testcase_10 AC 1,379 ms
85,120 KB
testcase_11 AC 1,124 ms
83,328 KB
testcase_12 AC 62 ms
67,072 KB
testcase_13 AC 129 ms
77,696 KB
testcase_14 AC 1,033 ms
82,048 KB
testcase_15 AC 40 ms
54,144 KB
testcase_16 WA -
testcase_17 AC 41 ms
53,760 KB
testcase_18 AC 943 ms
84,352 KB
testcase_19 AC 118 ms
77,184 KB
testcase_20 AC 764 ms
81,792 KB
testcase_21 AC 1,315 ms
85,248 KB
testcase_22 AC 65 ms
68,224 KB
testcase_23 WA -
testcase_24 AC 96 ms
77,184 KB
testcase_25 AC 79 ms
72,960 KB
testcase_26 AC 294 ms
77,568 KB
testcase_27 AC 369 ms
78,080 KB
testcase_28 AC 665 ms
78,720 KB
testcase_29 AC 328 ms
77,696 KB
testcase_30 AC 1,129 ms
84,736 KB
testcase_31 AC 65 ms
68,608 KB
testcase_32 WA -
testcase_33 AC 68 ms
68,608 KB
testcase_34 AC 192 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n,k = na()
a = na()
from collections import defaultdict
from math import gcd
dp = defaultdict(int)
dp[1] = 1

mod = 10**9+7
for i in range(n):
    p = defaultdict(int)
    p,dp = dp,p
    for j in p:
        nj = gcd(k,j*a[i])
        dp[nj]+=p[j]
        dp[j]+=p[j]
        if dp[nj]>=mod:
            dp[nj]-=mod
        if dp[j]>=mod:
            dp[j]-=mod
print(dp[k])
0