結果

問題 No.2682 Visible Divisible
ユーザー lloyzlloyz
提出日時 2024-04-14 23:18:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,300 KB
実行使用メモリ 105,972 KB
最終ジャッジ日時 2024-04-14 23:18:16
合計ジャッジ時間 4,695 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 189 ms
105,756 KB
testcase_01 AC 195 ms
105,436 KB
testcase_02 AC 197 ms
105,556 KB
testcase_03 AC 195 ms
105,468 KB
testcase_04 AC 207 ms
105,912 KB
testcase_05 AC 209 ms
105,808 KB
testcase_06 AC 197 ms
105,480 KB
testcase_07 AC 189 ms
104,932 KB
testcase_08 AC 39 ms
53,264 KB
testcase_09 AC 39 ms
52,736 KB
testcase_10 AC 38 ms
52,744 KB
testcase_11 AC 196 ms
105,800 KB
testcase_12 AC 201 ms
105,972 KB
testcase_13 AC 221 ms
105,768 KB
testcase_14 AC 201 ms
105,860 KB
testcase_15 AC 198 ms
105,040 KB
testcase_16 AC 203 ms
105,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(n):
    A[i] = gcd(A[i], k)
lcmA = 1
for i in range(n):
    lcmA = lcmA * A[i] // gcd(lcmA, A[i])
if lcmA % k == 0:
    print("Yes")
else:
    print("No")
0