結果

問題 No.2682 Visible Divisible
ユーザー 👑 H20H20
提出日時 2024-03-20 22:13:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 214 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 106,972 KB
最終ジャッジ日時 2024-03-20 22:13:33
合計ジャッジ時間 4,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 196 ms
106,228 KB
testcase_01 AC 203 ms
106,720 KB
testcase_02 AC 206 ms
106,788 KB
testcase_03 AC 206 ms
106,756 KB
testcase_04 AC 214 ms
106,512 KB
testcase_05 AC 211 ms
106,500 KB
testcase_06 AC 201 ms
106,888 KB
testcase_07 AC 194 ms
106,436 KB
testcase_08 AC 41 ms
53,716 KB
testcase_09 AC 42 ms
53,716 KB
testcase_10 AC 42 ms
53,716 KB
testcase_11 AC 210 ms
106,248 KB
testcase_12 AC 210 ms
106,972 KB
testcase_13 AC 201 ms
106,472 KB
testcase_14 AC 209 ms
106,768 KB
testcase_15 AC 203 ms
106,400 KB
testcase_16 AC 209 ms
106,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
import math
def my_lcm(x, y):
    return (x * y) // math.gcd(x, y)


N,K = map(int, input().split())
A = list(map(int, input().split())) 
v = 1
for a in A:
    gc = math.gcd(a,K)
    v = my_lcm(v,gc)
if v%K==0:
    print('Yes')
else:
    print('No')
0