結果

問題 No.1731 Product of Subsequence
ユーザー とりゐとりゐ
提出日時 2021-08-23 08:47:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 966 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 79,752 KB
最終ジャッジ日時 2024-04-25 17:08:31
合計ジャッジ時間 10,597 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 781 ms
79,152 KB
testcase_01 AC 42 ms
54,144 KB
testcase_02 AC 41 ms
54,096 KB
testcase_03 AC 41 ms
54,084 KB
testcase_04 AC 41 ms
55,056 KB
testcase_05 AC 46 ms
62,328 KB
testcase_06 AC 47 ms
61,908 KB
testcase_07 AC 42 ms
55,012 KB
testcase_08 AC 66 ms
66,252 KB
testcase_09 AC 55 ms
66,756 KB
testcase_10 AC 966 ms
79,388 KB
testcase_11 AC 822 ms
78,944 KB
testcase_12 AC 56 ms
65,552 KB
testcase_13 AC 82 ms
76,816 KB
testcase_14 AC 701 ms
78,208 KB
testcase_15 AC 41 ms
53,804 KB
testcase_16 AC 41 ms
53,976 KB
testcase_17 AC 41 ms
54,540 KB
testcase_18 AC 645 ms
79,752 KB
testcase_19 AC 80 ms
76,716 KB
testcase_20 AC 525 ms
78,124 KB
testcase_21 AC 919 ms
79,152 KB
testcase_22 AC 57 ms
68,128 KB
testcase_23 AC 55 ms
65,848 KB
testcase_24 AC 65 ms
66,852 KB
testcase_25 AC 57 ms
66,284 KB
testcase_26 AC 208 ms
76,800 KB
testcase_27 AC 258 ms
77,044 KB
testcase_28 AC 462 ms
77,088 KB
testcase_29 AC 222 ms
76,684 KB
testcase_30 AC 780 ms
78,808 KB
testcase_31 AC 57 ms
67,632 KB
testcase_32 AC 54 ms
64,908 KB
testcase_33 AC 57 ms
67,248 KB
testcase_34 AC 128 ms
76,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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