結果

問題 No.1250 汝は倍数なりや?
ユーザー nehan_der_thalnehan_der_thal
提出日時 2020-10-09 23:06:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 792 bytes
コンパイル時間 782 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 101,776 KB
最終ジャッジ日時 2023-09-27 19:27:36
合計ジャッジ時間 7,020 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,016 KB
testcase_01 AC 71 ms
70,972 KB
testcase_02 AC 74 ms
71,112 KB
testcase_03 AC 74 ms
71,296 KB
testcase_04 AC 71 ms
71,372 KB
testcase_05 AC 72 ms
70,956 KB
testcase_06 AC 72 ms
71,104 KB
testcase_07 AC 71 ms
71,092 KB
testcase_08 AC 71 ms
71,152 KB
testcase_09 AC 73 ms
70,960 KB
testcase_10 AC 71 ms
71,376 KB
testcase_11 AC 72 ms
71,328 KB
testcase_12 AC 72 ms
71,280 KB
testcase_13 AC 73 ms
71,108 KB
testcase_14 AC 71 ms
71,260 KB
testcase_15 AC 72 ms
71,276 KB
testcase_16 AC 73 ms
70,964 KB
testcase_17 AC 72 ms
71,248 KB
testcase_18 AC 71 ms
71,308 KB
testcase_19 AC 73 ms
71,300 KB
testcase_20 AC 72 ms
70,960 KB
testcase_21 AC 72 ms
71,136 KB
testcase_22 AC 73 ms
71,292 KB
testcase_23 AC 74 ms
71,316 KB
testcase_24 AC 81 ms
76,304 KB
testcase_25 AC 78 ms
76,172 KB
testcase_26 AC 77 ms
75,984 KB
testcase_27 AC 79 ms
76,448 KB
testcase_28 AC 74 ms
75,528 KB
testcase_29 AC 73 ms
71,212 KB
testcase_30 AC 77 ms
75,992 KB
testcase_31 AC 72 ms
71,164 KB
testcase_32 AC 80 ms
76,224 KB
testcase_33 AC 141 ms
99,872 KB
testcase_34 AC 108 ms
91,460 KB
testcase_35 AC 125 ms
101,776 KB
testcase_36 AC 137 ms
99,276 KB
testcase_37 AC 106 ms
91,756 KB
testcase_38 AC 109 ms
93,728 KB
testcase_39 AC 109 ms
91,520 KB
testcase_40 AC 109 ms
91,692 KB
testcase_41 AC 106 ms
96,004 KB
testcase_42 AC 100 ms
86,184 KB
testcase_43 AC 132 ms
99,628 KB
testcase_44 AC 98 ms
86,072 KB
testcase_45 AC 135 ms
99,496 KB
testcase_46 AC 97 ms
82,616 KB
testcase_47 AC 113 ms
93,744 KB
testcase_48 AC 72 ms
71,404 KB
testcase_49 AC 72 ms
70,984 KB
testcase_50 AC 70 ms
71,032 KB
testcase_51 AC 73 ms
71,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_de(number):
    factor = []
    div = 2
    while div*div <= number:
        cnt = 0
        while number % div == 0:
            cnt += 1
            number //= div
        if cnt != 0:
            factor.append([div, cnt])
        div += 1
    if number > 1:
        factor.append([number, 1])
    return factor

N, H = map(int, input().split())

X = prime_de(H)
A = list(map(int, input().split()))
if 0 in A:
    print("YES")
else:
    for a in A:
        for i in range(len(X)):
            x = X[i][0]
            while X[i][1]:
                if a%x==0:
                    a//=x
                    X[i][1] -= 1
                else:
                    break
    cc = 0
    for x, c in X:
        cc += c
    if cc == 0:
        print("YES")
    else:
        print("NO")
0