結果

問題 No.1250 汝は倍数なりや?
ユーザー NatsubiSoganNatsubiSogan
提出日時 2020-10-09 21:43:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,119 bytes
コンパイル時間 916 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 33,956 KB
最終ジャッジ日時 2023-09-27 15:58:39
合計ジャッジ時間 5,510 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
16,716 KB
testcase_01 AC 32 ms
12,360 KB
testcase_02 AC 33 ms
12,508 KB
testcase_03 AC 33 ms
12,436 KB
testcase_04 AC 32 ms
12,428 KB
testcase_05 AC 31 ms
12,336 KB
testcase_06 AC 32 ms
12,416 KB
testcase_07 AC 34 ms
12,340 KB
testcase_08 AC 35 ms
12,428 KB
testcase_09 AC 34 ms
12,432 KB
testcase_10 AC 32 ms
12,348 KB
testcase_11 WA -
testcase_12 AC 35 ms
12,416 KB
testcase_13 WA -
testcase_14 AC 35 ms
12,468 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 30 ms
12,396 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 30 ms
12,400 KB
testcase_23 AC 35 ms
12,416 KB
testcase_24 AC 37 ms
12,468 KB
testcase_25 AC 38 ms
12,360 KB
testcase_26 AC 34 ms
12,340 KB
testcase_27 AC 35 ms
12,336 KB
testcase_28 WA -
testcase_29 AC 37 ms
12,408 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 39 ms
12,444 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
from collections import Counter
def prime_numbers(x):
    if x < 2:
        return []
    prime_numbers = [i for i in range(x)]
    prime_numbers[1] = 0
    for prime_number in prime_numbers:
        if prime_number > math.sqrt(x):
            break
        if prime_number == 0:
            continue
        for composite_number in range(2 * prime_number, x, prime_number):
            prime_numbers[composite_number] = 0
    return [prime_number for prime_number in prime_numbers if prime_number != 0]
primes = prime_numbers(10 ** 5)
def soinnsuu(x):
    l = []
    for i in primes:
        if i > int(math.sqrt(x)):
            break
        elif x % i == 0:
            while x % i == 0:
                x //= i
            l.append(i)
    if not x == 1:
        l.append(x)
    return Counter(l)
n, h = map(int, input().split())
a = list(map(int, input().split()))
h = dict(soinnsuu(h))
for i in a:
    try:
        for j, k in soinnsuu(i).items():
            h[j] -= k
            h[j] = max(0, h[j])
    except:
        pass
if all(i == 0 for i in h.values()):
    print("YES")
else:
    print("NO")
0