結果

問題 No.1250 汝は倍数なりや?
ユーザー rei60rei60
提出日時 2020-10-24 21:43:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 691 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 102,124 KB
最終ジャッジ日時 2023-09-28 20:56:58
合計ジャッジ時間 7,354 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,508 KB
testcase_01 AC 75 ms
71,604 KB
testcase_02 AC 73 ms
71,508 KB
testcase_03 AC 74 ms
71,284 KB
testcase_04 AC 73 ms
71,704 KB
testcase_05 AC 74 ms
71,612 KB
testcase_06 AC 75 ms
71,420 KB
testcase_07 AC 76 ms
71,280 KB
testcase_08 AC 76 ms
71,132 KB
testcase_09 AC 76 ms
71,424 KB
testcase_10 AC 76 ms
71,552 KB
testcase_11 AC 75 ms
71,608 KB
testcase_12 AC 74 ms
71,460 KB
testcase_13 AC 73 ms
71,716 KB
testcase_14 AC 75 ms
71,632 KB
testcase_15 AC 73 ms
71,680 KB
testcase_16 AC 74 ms
71,616 KB
testcase_17 AC 75 ms
71,716 KB
testcase_18 AC 76 ms
71,360 KB
testcase_19 AC 72 ms
71,556 KB
testcase_20 AC 76 ms
71,536 KB
testcase_21 AC 73 ms
71,712 KB
testcase_22 AC 73 ms
71,128 KB
testcase_23 AC 74 ms
71,504 KB
testcase_24 AC 78 ms
76,308 KB
testcase_25 AC 78 ms
76,452 KB
testcase_26 AC 77 ms
76,236 KB
testcase_27 AC 78 ms
76,280 KB
testcase_28 AC 75 ms
75,884 KB
testcase_29 AC 72 ms
71,416 KB
testcase_30 AC 78 ms
76,300 KB
testcase_31 AC 74 ms
71,420 KB
testcase_32 AC 81 ms
76,268 KB
testcase_33 AC 146 ms
99,704 KB
testcase_34 AC 115 ms
91,728 KB
testcase_35 AC 131 ms
102,124 KB
testcase_36 AC 146 ms
99,528 KB
testcase_37 AC 108 ms
92,224 KB
testcase_38 AC 112 ms
94,044 KB
testcase_39 AC 120 ms
91,852 KB
testcase_40 AC 119 ms
91,892 KB
testcase_41 AC 106 ms
96,416 KB
testcase_42 AC 100 ms
86,616 KB
testcase_43 AC 141 ms
99,296 KB
testcase_44 AC 98 ms
86,412 KB
testcase_45 AC 138 ms
99,296 KB
testcase_46 AC 98 ms
83,052 KB
testcase_47 AC 120 ms
93,652 KB
testcase_48 AC 72 ms
71,216 KB
testcase_49 AC 76 ms
75,516 KB
testcase_50 AC 74 ms
71,528 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

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):
        if a%i==0:
            check[idx] -= 1

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