結果

問題 No.2682 Visible Divisible
ユーザー OhnoHirokiOhnoHiroki
提出日時 2024-03-21 00:17:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 957 ms / 2,000 ms
コード長 294 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 37,116 KB
最終ジャッジ日時 2024-03-21 00:17:49
合計ジャッジ時間 15,491 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 923 ms
34,692 KB
testcase_01 AC 904 ms
34,708 KB
testcase_02 AC 957 ms
35,096 KB
testcase_03 AC 932 ms
35,288 KB
testcase_04 AC 934 ms
34,928 KB
testcase_05 AC 917 ms
34,360 KB
testcase_06 AC 872 ms
37,116 KB
testcase_07 AC 897 ms
34,372 KB
testcase_08 AC 39 ms
9,984 KB
testcase_09 AC 29 ms
9,984 KB
testcase_10 AC 29 ms
9,984 KB
testcase_11 AC 934 ms
36,524 KB
testcase_12 AC 952 ms
34,628 KB
testcase_13 AC 865 ms
36,220 KB
testcase_14 AC 949 ms
34,884 KB
testcase_15 AC 924 ms
34,448 KB
testcase_16 AC 893 ms
36,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""
最小公倍数
"""
def gcd(x, y):
    while y > 0:
        x,y = y,x%y
    return x

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