結果

問題 No.2682 Visible Divisible
ユーザー 👑 H20H20
提出日時 2024-03-20 21:48:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 544 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 112,356 KB
最終ジャッジ日時 2024-03-20 21:48:09
合計ジャッジ時間 4,880 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
106,480 KB
testcase_01 AC 117 ms
106,400 KB
testcase_02 AC 138 ms
106,472 KB
testcase_03 AC 114 ms
106,436 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

N,K = map(int, input().split())
A = list(map(int, input().split())) 
C = collections.Counter(prime_factorize(K))
for k,v in C.items():
    for a in A:
        if a%(k**v)==0:
            break
    else:
        print('No')
        exit()
print('Yes')
0