結果

問題 No.2682 Visible Divisible
ユーザー titiatitia
提出日時 2024-03-20 22:11:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 341 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 36,532 KB
最終ジャッジ日時 2024-03-20 22:11:35
合計ジャッジ時間 6,139 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
35,672 KB
testcase_01 AC 310 ms
34,776 KB
testcase_02 AC 312 ms
36,104 KB
testcase_03 AC 307 ms
36,172 KB
testcase_04 AC 312 ms
36,532 KB
testcase_05 AC 309 ms
34,428 KB
testcase_06 AC 294 ms
35,580 KB
testcase_07 AC 283 ms
35,976 KB
testcase_08 AC 32 ms
9,984 KB
testcase_09 AC 30 ms
9,984 KB
testcase_10 AC 29 ms
9,984 KB
testcase_11 AC 308 ms
35,020 KB
testcase_12 AC 303 ms
34,564 KB
testcase_13 AC 287 ms
34,656 KB
testcase_14 AC 341 ms
35,740 KB
testcase_15 AC 313 ms
36,052 KB
testcase_16 AC 302 ms
34,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from math import gcd

def lcm(x,y):
    return x*y//gcd(x,y)

N,K=map(int,input().split())
A=list(map(int,input().split()))

LCM=1

for a in A:
    GCD=gcd(a,K)

    LCM=lcm(LCM,GCD)

if LCM%K==0:
    print("Yes")
else:
    print("No")
0