結果

問題 No.2682 Visible Divisible
ユーザー pitPpitP
提出日時 2024-03-20 23:31:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 107,060 KB
最終ジャッジ日時 2024-03-20 23:32:01
合計ジャッジ時間 4,560 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 189 ms
106,892 KB
testcase_01 AC 209 ms
106,780 KB
testcase_02 AC 196 ms
106,748 KB
testcase_03 AC 194 ms
106,704 KB
testcase_04 AC 206 ms
107,044 KB
testcase_05 AC 199 ms
107,032 KB
testcase_06 AC 201 ms
106,840 KB
testcase_07 AC 193 ms
106,300 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 196 ms
107,032 KB
testcase_12 AC 199 ms
106,976 KB
testcase_13 AC 192 ms
107,008 KB
testcase_14 AC 199 ms
106,992 KB
testcase_15 AC 204 ms
106,268 KB
testcase_16 AC 200 ms
107,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = [gcd(A[i], K) for i in range(N)]

l = 1
for i in range(N):
    l = l * A[i] // gcd(l, A[i])
    if l > K:
        exit(print("No"))

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