結果

問題 No.1250 汝は倍数なりや?
ユーザー aaaaaaaaaa2230
提出日時 2021-05-12 21:49:06
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 530 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 82,148 KB
最終ジャッジ日時 2024-09-24 08:35:43
合計ジャッジ時間 4,315 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 TLE * 1 -- * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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)

dic2 = {}
for i in s:
    dic2[i] = 0
for a in A:
    now = a
    for c in s:
        while now%c == 0:
            now //= c
            dic2[c] += 1

for c in s:
    if dic[c] > dic2[c]:
        print("NO")
        exit()
print("YES")
0