結果

問題 No.2811 Calculation Within Sequence
ユーザー i_taku
提出日時 2024-07-19 21:39:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 162,512 KB
最終ジャッジ日時 2024-07-19 21:39:11
合計ジャッジ時間 8,105 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())
T = list(map(int, input().split()))
S = list(map(int, input().split()))
if len(set(T)) == 1:
    if all(s % T[0] == 0 for s in S):
        print('Yes')
    else:
        print('No')
    exit()
if all(t & 1 == 0 for t in T):
    if any(s & 1 for s in S):
        print('No')
    else:
        print('Yes')
    exit()
if any(t & 1 for t in T):
    print('Yes')
    exit()
print('No')
0