結果
| 問題 | No.1250 汝は倍数なりや? | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-05-12 21:42:53 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 547 bytes | 
| コンパイル時間 | 265 ms | 
| コンパイル使用メモリ | 82,032 KB | 
| 実行使用メモリ | 107,904 KB | 
| 最終ジャッジ日時 | 2024-09-24 08:25:48 | 
| 合計ジャッジ時間 | 5,899 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 RE * 2 | 
| other | AC * 11 RE * 38 | 
ソースコード
n,h = map(int,input().split())
A = list(map(int,input().split()))
dic = {}
s = set()
now = h
for i in range(2,int(h**0.5)+1):
    if now%i:
        continue
    dic[i] = 0
    s.add(i)
    while now % i == 0:
        now //= i
        dic[i] += 1
if now != 1:
    dic[now] = 1
    s.add(now)
for a in A:
    now = a
    for c in s:
        if now%c:
            continue
        while now%c == 0:
            now //= c
            dic[c] -= 1
        if dic[c] <= 0:
            s.remove(c)
if len(s) != 0:
    print("NO")
else:
    print("YES")
            
            
            
        