結果

問題 No.2682 Visible Divisible
ユーザー pitPpitP
提出日時 2024-03-20 21:44:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 337 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 104,936 KB
最終ジャッジ日時 2024-03-20 21:44:26
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 103 ms
104,836 KB
testcase_05 AC 103 ms
104,832 KB
testcase_06 AC 102 ms
104,636 KB
testcase_07 WA -
testcase_08 AC 37 ms
53,588 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 103 ms
104,780 KB
testcase_12 AC 103 ms
104,764 KB
testcase_13 WA -
testcase_14 AC 103 ms
104,780 KB
testcase_15 WA -
testcase_16 AC 103 ms
104,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N, K = map(int, input().split())
A = list(map(int, input().split()))
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