結果

問題 No.2682 Visible Divisible
ユーザー pitPpitP
提出日時 2024-03-20 21:46:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 366 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 141,328 KB
最終ジャッジ日時 2024-03-20 21:47:03
合計ジャッジ時間 5,473 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 291 ms
141,200 KB
testcase_01 AC 279 ms
141,248 KB
testcase_02 AC 279 ms
141,328 KB
testcase_03 AC 282 ms
141,256 KB
testcase_04 AC 136 ms
139,412 KB
testcase_05 AC 132 ms
139,416 KB
testcase_06 AC 133 ms
139,388 KB
testcase_07 AC 285 ms
140,436 KB
testcase_08 AC 36 ms
53,588 KB
testcase_09 AC 36 ms
53,588 KB
testcase_10 AC 36 ms
53,588 KB
testcase_11 AC 280 ms
141,208 KB
testcase_12 AC 284 ms
141,284 KB
testcase_13 WA -
testcase_14 AC 276 ms
141,296 KB
testcase_15 AC 270 ms
140,412 KB
testcase_16 AC 297 ms
141,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N, K = map(int, input().split())
A = list(map(int, input().split()))

A = list(set(A))
N = len(A)

for i in range(N):
    if A[i] % K == 0:
        exit(print("Yes"))

g = A[0]
for i in range(N): 
    g = gcd(g, A[i])

K //= gcd(g, K)
A = [A[i] // g for i in range(N)]

for i in range(N):
    K //= gcd(K, A[i])

print("Yes" if K == 1 else "No")
0