結果

問題 No.1250 汝は倍数なりや?
ユーザー hir355hir355
提出日時 2020-10-09 21:28:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 558 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 109,904 KB
最終ジャッジ日時 2023-09-27 14:39:51
合計ジャッジ時間 6,917 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
71,428 KB
testcase_01 AC 84 ms
71,544 KB
testcase_02 AC 81 ms
71,584 KB
testcase_03 AC 81 ms
71,552 KB
testcase_04 AC 80 ms
71,692 KB
testcase_05 AC 77 ms
71,724 KB
testcase_06 AC 77 ms
71,544 KB
testcase_07 AC 77 ms
71,544 KB
testcase_08 AC 76 ms
71,456 KB
testcase_09 AC 77 ms
71,604 KB
testcase_10 AC 76 ms
71,520 KB
testcase_11 AC 75 ms
71,780 KB
testcase_12 AC 77 ms
71,776 KB
testcase_13 AC 79 ms
71,560 KB
testcase_14 AC 75 ms
71,696 KB
testcase_15 AC 78 ms
71,800 KB
testcase_16 AC 77 ms
71,612 KB
testcase_17 AC 78 ms
71,544 KB
testcase_18 AC 77 ms
71,568 KB
testcase_19 AC 78 ms
71,636 KB
testcase_20 AC 76 ms
71,796 KB
testcase_21 AC 75 ms
71,428 KB
testcase_22 AC 76 ms
71,300 KB
testcase_23 AC 78 ms
71,540 KB
testcase_24 AC 82 ms
76,936 KB
testcase_25 AC 84 ms
77,148 KB
testcase_26 AC 82 ms
77,056 KB
testcase_27 AC 83 ms
76,924 KB
testcase_28 AC 81 ms
76,964 KB
testcase_29 AC 75 ms
71,524 KB
testcase_30 AC 83 ms
77,060 KB
testcase_31 AC 76 ms
71,516 KB
testcase_32 AC 84 ms
76,956 KB
testcase_33 AC 136 ms
109,904 KB
testcase_34 AC 109 ms
92,208 KB
testcase_35 AC 125 ms
103,296 KB
testcase_36 AC 134 ms
106,180 KB
testcase_37 AC 106 ms
92,532 KB
testcase_38 AC 110 ms
94,540 KB
testcase_39 AC 112 ms
92,244 KB
testcase_40 AC 112 ms
92,544 KB
testcase_41 AC 111 ms
97,296 KB
testcase_42 AC 107 ms
87,176 KB
testcase_43 AC 128 ms
106,240 KB
testcase_44 AC 100 ms
87,112 KB
testcase_45 AC 128 ms
106,224 KB
testcase_46 AC 103 ms
83,584 KB
testcase_47 AC 118 ms
94,612 KB
testcase_48 AC 75 ms
71,348 KB
testcase_49 AC 78 ms
71,644 KB
testcase_50 AC 78 ms
71,720 KB
testcase_51 AC 79 ms
71,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def factorize(n):
    a = 2
    fct = []
    while a * a <= n:
        while n % a == 0:
            n //= a
            fct.append(a)
        a += 1
    if n > 1:
        fct.append(n)
    return fct


n, h = map(int, input().split())
p = Counter(factorize(h))
a = list(map(int, input().split()))
keys = list(p.keys())
for x in a:
    for k in keys:
        while p[k] > 0 and x % k == 0:
            p[k] -= 1
            x //= k
for v in p.values():
    if v > 0:
        print('NO')
        break
else:
    print('YES')
0