結果

問題 No.1250 汝は倍数なりや?
ユーザー GrayCoderGrayCoder
提出日時 2020-10-09 21:58:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 114 ms / 1,000 ms
コード長 679 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,868 KB
実行使用メモリ 39,308 KB
最終ジャッジ日時 2023-09-27 16:51:01
合計ジャッジ時間 3,906 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,864 KB
testcase_01 AC 14 ms
7,864 KB
testcase_02 AC 14 ms
8,004 KB
testcase_03 AC 15 ms
7,864 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 14 ms
7,984 KB
testcase_06 AC 14 ms
7,924 KB
testcase_07 AC 14 ms
7,884 KB
testcase_08 AC 14 ms
7,960 KB
testcase_09 AC 14 ms
7,884 KB
testcase_10 AC 14 ms
7,980 KB
testcase_11 AC 15 ms
7,868 KB
testcase_12 AC 14 ms
8,000 KB
testcase_13 AC 14 ms
7,864 KB
testcase_14 AC 15 ms
7,828 KB
testcase_15 AC 15 ms
7,884 KB
testcase_16 AC 15 ms
7,816 KB
testcase_17 AC 15 ms
7,960 KB
testcase_18 AC 14 ms
7,804 KB
testcase_19 AC 15 ms
7,888 KB
testcase_20 AC 14 ms
7,984 KB
testcase_21 AC 15 ms
7,804 KB
testcase_22 AC 15 ms
7,812 KB
testcase_23 AC 16 ms
8,344 KB
testcase_24 AC 14 ms
8,224 KB
testcase_25 AC 14 ms
8,460 KB
testcase_26 AC 14 ms
7,888 KB
testcase_27 AC 15 ms
8,268 KB
testcase_28 AC 15 ms
7,924 KB
testcase_29 AC 14 ms
7,884 KB
testcase_30 AC 15 ms
8,428 KB
testcase_31 AC 15 ms
7,824 KB
testcase_32 AC 13 ms
8,348 KB
testcase_33 AC 114 ms
39,308 KB
testcase_34 AC 56 ms
23,960 KB
testcase_35 AC 95 ms
37,492 KB
testcase_36 AC 104 ms
38,032 KB
testcase_37 AC 63 ms
24,740 KB
testcase_38 AC 70 ms
25,216 KB
testcase_39 AC 56 ms
24,008 KB
testcase_40 AC 59 ms
24,212 KB
testcase_41 AC 79 ms
26,212 KB
testcase_42 AC 47 ms
17,684 KB
testcase_43 AC 103 ms
39,092 KB
testcase_44 AC 47 ms
17,812 KB
testcase_45 AC 102 ms
38,196 KB
testcase_46 AC 39 ms
15,352 KB
testcase_47 AC 61 ms
24,828 KB
testcase_48 AC 15 ms
7,984 KB
testcase_49 AC 15 ms
7,808 KB
testcase_50 AC 15 ms
7,832 KB
testcase_51 AC 15 ms
7,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def prime_factors(n):
    ret = []
    apnd = ret.append
    while n >= 4:
        if n % 2:
            break
        else:
            n //= 2
            apnd(2)
    i = 3
    while n >= i * i:
        if n % i:
            i += 2
        else:
            n //= i
            apnd(i)
    apnd(n)
    return ret


def main():
    input = lambda: stdin.readline()[:-1]
    N, H = map(int, input().split())
    A = set(map(int, input().split()))

    primes = set(prime_factors(H))
    for p in primes:
        for a in A:
            if not a % p:
                break
        else:
            print("NO")
            return
    print("YES")


main()
0