結果
| 問題 | No.2811 Calculation Within Sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-20 19:32:33 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 120 ms / 2,000 ms |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 307 ms |
| コンパイル使用メモリ | 85,716 KB |
| 実行使用メモリ | 116,968 KB |
| 最終ジャッジ日時 | 2026-04-03 02:14:26 |
| 合計ジャッジ時間 | 8,262 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
a,b = map(int,input().split())
T = list(map(int,input().split()))
S = list(map(int,input().split()))
def gcd(a,b):
while b:
a,b = b,a % b
return a
now = T[0]
for i in range(1,a):
now = gcd(now,T[i])
import sys
for s in S:
if s % now != 0:
print('No')
exit()
print('Yes')