結果

問題 No.1250 汝は倍数なりや?
ユーザー toshiro_yanagi
提出日時 2023-07-03 20:57:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 1,000 ms
コード長 248 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 81,912 KB
実行使用メモリ 107,564 KB
最終ジャッジ日時 2024-07-17 18:51:32
合計ジャッジ時間 5,915 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(a, b):
    while min(a, b) > 0:
        a, b = max(a, b), min(a, b)
        a %= b
    return max(a, b)


(n, h), a = [[*map(int, input().split())] for _ in range(2)]
for ai in a:
    h //= gcd(h, abs(ai))

print("YES" if h == 1 else "NO")
0