結果

問題 No.2811 Calculation Within Sequence
ユーザー miho-4
提出日時 2024-07-19 21:32:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 269 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,084 KB
実行使用メモリ 142,360 KB
最終ジャッジ日時 2024-07-19 21:32:18
合計ジャッジ時間 8,254 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n,m=map(int,input().split())
T=list(map(int,input().split()))+[0]*max(0,m-m)
S=list(map(int,input().split()))+[0]*max(0,n-m)

x=math.gcd(*T)
if x==0:
  x=1
flag=1
for i in range(m):
  if (S[i]-T[i])%x!=0:
    flag=0
    break
print("Yes" if flag else "No")
0