結果
問題 |
No.1538 引きこもりさんは引き算が得意。
|
ユーザー |
![]() |
提出日時 | 2025-06-12 15:40:35 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 377 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 82,292 KB |
実行使用メモリ | 57,280 KB |
最終ジャッジ日時 | 2025-06-12 15:40:39 |
合計ジャッジ時間 | 4,568 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 14 |
ソースコード
import math from functools import reduce n, k = map(int, input().split()) a = list(map(int, input().split())) def gcd_all(lst): non_zero = [x for x in lst if x != 0] if not non_zero: return 0 return reduce(math.gcd, (abs(x) for x in non_zero)) d = gcd_all(a) if d == 0: print("Yes" if k == 0 else "No") else: print("Yes" if k % d == 0 else "No")