結果
| 問題 | No.1250 汝は倍数なりや? | 
| コンテスト | |
| ユーザー |  Kude | 
| 提出日時 | 2020-10-09 21:34:12 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 131 ms / 1,000 ms | 
| コード長 | 464 bytes | 
| コンパイル時間 | 176 ms | 
| コンパイル使用メモリ | 81,920 KB | 
| 実行使用メモリ | 102,052 KB | 
| 最終ジャッジ日時 | 2024-07-20 09:34:36 | 
| 合計ジャッジ時間 | 4,932 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 49 | 
ソースコード
n, h = map(int, input().split())
if h == 1:
    print('YES')
    exit()
d = {}
p = 2
while p * p <= h:
    cnt = 0
    while h % p == 0:
        cnt += 1
        h //= p
    if cnt:
        d[p] = cnt
    p += 1
if h > 1:
    d[h] = 1
for a in map(int, input().split()):
    if a == 0:
        print('YES')
        exit()
    for p in d:
        while a % p == 0:
            d[p] -= 1
            a //= p
print('YES' if all(v <= 0 for v in  d.values()) else 'NO')
            
            
            
        