結果

問題 No.1731 Product of Subsequence
ユーザー とりゐとりゐ
提出日時 2021-10-25 21:11:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,126 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 86,608 KB
実行使用メモリ 90,724 KB
最終ジャッジ日時 2023-08-07 22:53:35
合計ジャッジ時間 14,044 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 936 ms
87,876 KB
testcase_01 AC 94 ms
71,388 KB
testcase_02 AC 94 ms
71,612 KB
testcase_03 AC 96 ms
71,656 KB
testcase_04 AC 93 ms
71,500 KB
testcase_05 AC 103 ms
77,508 KB
testcase_06 AC 104 ms
77,380 KB
testcase_07 AC 95 ms
71,588 KB
testcase_08 AC 126 ms
77,764 KB
testcase_09 AC 110 ms
78,088 KB
testcase_10 AC 1,125 ms
90,540 KB
testcase_11 AC 958 ms
87,260 KB
testcase_12 AC 110 ms
78,140 KB
testcase_13 AC 134 ms
78,084 KB
testcase_14 AC 864 ms
86,416 KB
testcase_15 AC 94 ms
71,584 KB
testcase_16 AC 95 ms
71,452 KB
testcase_17 AC 93 ms
71,772 KB
testcase_18 AC 720 ms
81,792 KB
testcase_19 AC 143 ms
78,208 KB
testcase_20 AC 600 ms
81,176 KB
testcase_21 AC 1,126 ms
90,724 KB
testcase_22 AC 114 ms
78,048 KB
testcase_23 AC 111 ms
77,936 KB
testcase_24 AC 128 ms
77,716 KB
testcase_25 AC 114 ms
77,888 KB
testcase_26 AC 288 ms
78,824 KB
testcase_27 AC 352 ms
79,284 KB
testcase_28 AC 590 ms
81,024 KB
testcase_29 AC 303 ms
78,704 KB
testcase_30 AC 948 ms
88,052 KB
testcase_31 AC 111 ms
77,764 KB
testcase_32 AC 109 ms
77,860 KB
testcase_33 AC 112 ms
78,040 KB
testcase_34 AC 194 ms
78,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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