結果

問題 No.1538 引きこもりさんは引き算が得意。
ユーザー gew1fw
提出日時 2025-06-12 20:40:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2025-06-12 20:40:53
合計ジャッジ時間 3,944 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0