結果

問題 No.1250 汝は倍数なりや?
ユーザー hir355hir355
提出日時 2020-10-09 21:26:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 553 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 109,144 KB
最終ジャッジ日時 2023-09-27 14:21:06
合計ジャッジ時間 6,751 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 82 ms
71,660 KB
testcase_02 WA -
testcase_03 AC 78 ms
71,712 KB
testcase_04 WA -
testcase_05 AC 77 ms
71,328 KB
testcase_06 AC 79 ms
71,688 KB
testcase_07 AC 78 ms
71,540 KB
testcase_08 AC 77 ms
71,464 KB
testcase_09 AC 77 ms
71,516 KB
testcase_10 AC 74 ms
71,544 KB
testcase_11 WA -
testcase_12 AC 77 ms
71,700 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 76 ms
71,616 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 77 ms
71,640 KB
testcase_24 AC 82 ms
76,792 KB
testcase_25 AC 82 ms
77,276 KB
testcase_26 WA -
testcase_27 AC 82 ms
77,200 KB
testcase_28 WA -
testcase_29 AC 77 ms
71,660 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 134 ms
109,144 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 109 ms
92,740 KB
testcase_38 AC 110 ms
94,764 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 110 ms
97,180 KB
testcase_42 AC 100 ms
87,120 KB
testcase_43 AC 127 ms
105,816 KB
testcase_44 AC 101 ms
87,212 KB
testcase_45 WA -
testcase_46 AC 96 ms
83,768 KB
testcase_47 WA -
testcase_48 AC 77 ms
71,656 KB
testcase_49 AC 77 ms
71,624 KB
testcase_50 WA -
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = 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