結果

問題 No.2682 Visible Divisible
ユーザー 👑 rin204rin204
提出日時 2024-02-29 21:45:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 105,732 KB
最終ジャッジ日時 2024-02-29 21:45:09
合計ジャッジ時間 6,043 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
105,592 KB
testcase_01 AC 200 ms
105,508 KB
testcase_02 AC 208 ms
105,448 KB
testcase_03 AC 202 ms
105,412 KB
testcase_04 AC 209 ms
105,620 KB
testcase_05 AC 204 ms
105,612 KB
testcase_06 AC 197 ms
105,416 KB
testcase_07 AC 197 ms
104,876 KB
testcase_08 AC 36 ms
53,460 KB
testcase_09 AC 36 ms
53,460 KB
testcase_10 AC 36 ms
53,460 KB
testcase_11 AC 198 ms
105,732 KB
testcase_12 AC 201 ms
105,548 KB
testcase_13 AC 195 ms
105,712 KB
testcase_14 AC 204 ms
105,688 KB
testcase_15 AC 208 ms
104,972 KB
testcase_16 AC 201 ms
105,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

n, k = map(int, input().split())
A = list(map(int, input().split()))
assert 1 <= n <= 200000
assert 1 <= k <= 10**18
assert len(A) == n
assert all(1 <= a <= 10**18 for a in A)

lc = 1
for a in A:
    a = gcd(a, k)
    lc = lc * a // gcd(lc, a)

if lc == k:
    print("Yes")
else:
    print("No")
0