結果

問題 No.1250 汝は倍数なりや?
ユーザー rei60rei60
提出日時 2020-10-24 21:51:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 149 ms / 1,000 ms
コード長 731 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 102,268 KB
最終ジャッジ日時 2023-09-28 20:57:47
合計ジャッジ時間 7,022 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,772 KB
testcase_01 AC 73 ms
71,504 KB
testcase_02 AC 73 ms
71,280 KB
testcase_03 AC 75 ms
71,356 KB
testcase_04 AC 74 ms
71,684 KB
testcase_05 AC 72 ms
71,508 KB
testcase_06 AC 73 ms
71,140 KB
testcase_07 AC 74 ms
71,500 KB
testcase_08 AC 74 ms
71,616 KB
testcase_09 AC 74 ms
71,676 KB
testcase_10 AC 74 ms
71,656 KB
testcase_11 AC 75 ms
71,612 KB
testcase_12 AC 75 ms
71,440 KB
testcase_13 AC 75 ms
71,512 KB
testcase_14 AC 74 ms
71,600 KB
testcase_15 AC 75 ms
71,596 KB
testcase_16 AC 75 ms
71,740 KB
testcase_17 AC 74 ms
71,740 KB
testcase_18 AC 76 ms
71,572 KB
testcase_19 AC 75 ms
71,416 KB
testcase_20 AC 75 ms
71,380 KB
testcase_21 AC 75 ms
71,312 KB
testcase_22 AC 75 ms
71,284 KB
testcase_23 AC 76 ms
71,508 KB
testcase_24 AC 80 ms
76,200 KB
testcase_25 AC 80 ms
76,332 KB
testcase_26 AC 78 ms
76,256 KB
testcase_27 AC 80 ms
75,764 KB
testcase_28 AC 78 ms
76,012 KB
testcase_29 AC 76 ms
71,628 KB
testcase_30 AC 81 ms
76,428 KB
testcase_31 AC 76 ms
71,632 KB
testcase_32 AC 82 ms
76,320 KB
testcase_33 AC 149 ms
99,524 KB
testcase_34 AC 118 ms
91,880 KB
testcase_35 AC 131 ms
102,268 KB
testcase_36 AC 149 ms
99,376 KB
testcase_37 AC 112 ms
91,848 KB
testcase_38 AC 114 ms
94,232 KB
testcase_39 AC 120 ms
91,964 KB
testcase_40 AC 122 ms
91,884 KB
testcase_41 AC 109 ms
96,376 KB
testcase_42 AC 102 ms
86,492 KB
testcase_43 AC 143 ms
99,268 KB
testcase_44 AC 102 ms
86,628 KB
testcase_45 AC 142 ms
99,420 KB
testcase_46 AC 96 ms
83,032 KB
testcase_47 AC 123 ms
94,048 KB
testcase_48 AC 74 ms
71,396 KB
testcase_49 AC 76 ms
75,644 KB
testcase_50 AC 74 ms
71,564 KB
testcase_51 AC 77 ms
75,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-


N, H = map(int,input().split())
A = list(map(int, input().split()))

def fact(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr

divlis = fact(H)

div, check = list(map(list,zip(*divlis)))

for a in A:
    for idx, i in enumerate(div):
        while a%i==0 and check[idx]>0:
            check[idx] -= 1
            a //= i

for c in check:
    if c>0:
        print("NO")
        quit()
print("YES")
        
    
    
0