結果
| 問題 |
No.2811 Calculation Within Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-19 21:36:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 200 ms / 2,000 ms |
| コード長 | 246 bytes |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 82,860 KB |
| 実行使用メモリ | 132,004 KB |
| 最終ジャッジ日時 | 2024-07-19 21:36:54 |
| 合計ジャッジ時間 | 8,178 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
import math
a,b=map(int,input().split())
t=list(map(int,input().split()))
s=list(map(int,input().split()))
x=t[0]
y=s[0]
for i in range(1,a):
x=math.gcd(x,t[i])
for i in range(1,b):
y=math.gcd(y,s[i])
if y%x==0:
print('Yes')
else:
print('No')