結果

問題 No.2682 Visible Divisible
ユーザー rlangevinrlangevin
提出日時 2024-03-20 21:18:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 105,732 KB
最終ジャッジ日時 2024-03-20 21:18:29
合計ジャッジ時間 4,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 188 ms
105,488 KB
testcase_01 AC 195 ms
105,400 KB
testcase_02 AC 199 ms
105,340 KB
testcase_03 AC 195 ms
105,300 KB
testcase_04 AC 203 ms
105,636 KB
testcase_05 AC 199 ms
105,632 KB
testcase_06 AC 194 ms
105,436 KB
testcase_07 AC 185 ms
104,904 KB
testcase_08 AC 36 ms
53,588 KB
testcase_09 AC 36 ms
53,588 KB
testcase_10 AC 35 ms
53,588 KB
testcase_11 AC 196 ms
105,628 KB
testcase_12 AC 202 ms
105,568 KB
testcase_13 AC 193 ms
105,732 KB
testcase_14 AC 201 ms
105,584 KB
testcase_15 AC 196 ms
104,860 KB
testcase_16 AC 202 ms
105,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 1
for i in range(N):
    g = gcd(K, A[i])
    ans = lcm(g, ans)
    
print("Yes") if ans == K else print("No")
0