結果

問題 No.2811 Calculation Within Sequence
ユーザー usatyo
提出日時 2024-07-19 21:57:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 132,404 KB
最終ジャッジ日時 2024-07-19 21:57:38
合計ジャッジ時間 8,213 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd


a, b = map(int, input().split())
t = list(map(int, input().split()))
s = list(map(int, input().split()))

g1, g2 = 0, 0

for x in t:
    g1 = gcd(g1, x)

for x in s:
    g2 = gcd(g2, x)

if g2 % g1 == 0:
    print("Yes")
else:
    print("No")
0