結果

問題 No.1250 汝は倍数なりや?
ユーザー tanon710tanon710
提出日時 2020-10-10 00:28:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 1,000 ms
コード長 602 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 110,260 KB
最終ジャッジ日時 2023-09-27 20:26:07
合計ジャッジ時間 7,193 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,848 KB
testcase_01 AC 82 ms
71,852 KB
testcase_02 AC 82 ms
72,212 KB
testcase_03 AC 82 ms
71,668 KB
testcase_04 AC 80 ms
71,856 KB
testcase_05 AC 78 ms
71,960 KB
testcase_06 AC 80 ms
72,088 KB
testcase_07 AC 79 ms
71,668 KB
testcase_08 AC 79 ms
71,852 KB
testcase_09 AC 88 ms
71,864 KB
testcase_10 AC 79 ms
71,720 KB
testcase_11 AC 80 ms
71,676 KB
testcase_12 AC 83 ms
71,996 KB
testcase_13 AC 80 ms
71,668 KB
testcase_14 AC 80 ms
71,976 KB
testcase_15 AC 81 ms
71,812 KB
testcase_16 AC 80 ms
72,088 KB
testcase_17 AC 80 ms
71,852 KB
testcase_18 AC 80 ms
72,080 KB
testcase_19 AC 81 ms
71,956 KB
testcase_20 AC 81 ms
71,776 KB
testcase_21 AC 83 ms
71,716 KB
testcase_22 AC 83 ms
71,768 KB
testcase_23 AC 85 ms
71,664 KB
testcase_24 AC 88 ms
77,520 KB
testcase_25 AC 87 ms
77,420 KB
testcase_26 AC 82 ms
77,700 KB
testcase_27 AC 87 ms
77,572 KB
testcase_28 AC 88 ms
77,344 KB
testcase_29 AC 80 ms
72,084 KB
testcase_30 AC 87 ms
77,300 KB
testcase_31 AC 83 ms
71,800 KB
testcase_32 AC 87 ms
77,508 KB
testcase_33 AC 148 ms
110,260 KB
testcase_34 AC 121 ms
92,816 KB
testcase_35 AC 142 ms
103,676 KB
testcase_36 AC 144 ms
106,632 KB
testcase_37 AC 114 ms
92,976 KB
testcase_38 AC 116 ms
94,976 KB
testcase_39 AC 118 ms
92,920 KB
testcase_40 AC 119 ms
93,096 KB
testcase_41 AC 115 ms
97,568 KB
testcase_42 AC 106 ms
87,812 KB
testcase_43 AC 131 ms
105,788 KB
testcase_44 AC 115 ms
87,632 KB
testcase_45 AC 137 ms
106,772 KB
testcase_46 AC 100 ms
84,304 KB
testcase_47 AC 120 ms
95,268 KB
testcase_48 AC 79 ms
71,692 KB
testcase_49 AC 81 ms
76,776 KB
testcase_50 AC 79 ms
71,892 KB
testcase_51 AC 84 ms
76,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

def ps(n):
    ret=collections.defaultdict(int)
    for i in range(2,int(n**0.5)+1):
        while n%i==0:
            ret[i]+=1
            n//=i
    if n!=1:
        ret[n]+=1
    return ret

n,h=map(int,input().split())
arr=list(map(int,input().split()))
primes=ps(h)
for val in arr:
    for p in primes.keys():
        if primes[p]==0:
            continue
        while val%p==0:
            primes[p]-=1
            val//=p
            if primes[p]==0:
                break
for p in primes.keys():
    if primes[p]!=0:
        print('NO')
        break
else:
    print('YES')
0