結果

問題 No.2682 Visible Divisible
コンテスト
ユーザー H20
提出日時 2024-03-20 22:13:24
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 196 ms / 2,000 ms
+ 335µs
コード長 268 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 232 ms
コンパイル使用メモリ 95,440 KB
実行使用メモリ 122,904 KB
最終ジャッジ日時 2026-09-06 14:55:41
合計ジャッジ時間 6,706 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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