結果
問題 |
No.1538 引きこもりさんは引き算が得意。
|
ユーザー |
![]() |
提出日時 | 2025-06-12 15:36:28 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 323 ms |
コンパイル使用メモリ | 82,680 KB |
実行使用メモリ | 54,540 KB |
最終ジャッジ日時 | 2025-06-12 15:37:46 |
合計ジャッジ時間 | 4,008 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 14 |
ソースコード
import sys import math def compute_gcd(list_numbers): gcd = list_numbers[0] for num in list_numbers[1:]: gcd = math.gcd(gcd, num) return gcd def main(): input = sys.stdin.read().split() N = int(input[0]) K = int(input[1]) A = list(map(int, input[2:2+N])) d = compute_gcd(A) if d == 0: print("Yes" if K == 0 else "No") else: if K % d != 0: print("No") else: print("Yes") if __name__ == "__main__": main()