結果

問題 No.1250 汝は倍数なりや?
ユーザー KudeKude
提出日時 2020-10-09 21:34:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 464 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 100,324 KB
最終ジャッジ日時 2023-09-27 15:26:45
合計ジャッジ時間 6,245 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,228 KB
testcase_01 AC 65 ms
71,412 KB
testcase_02 AC 64 ms
71,272 KB
testcase_03 AC 64 ms
71,108 KB
testcase_04 AC 65 ms
71,268 KB
testcase_05 AC 62 ms
71,188 KB
testcase_06 AC 61 ms
71,368 KB
testcase_07 AC 64 ms
71,268 KB
testcase_08 AC 63 ms
71,112 KB
testcase_09 AC 62 ms
71,484 KB
testcase_10 AC 64 ms
71,296 KB
testcase_11 AC 63 ms
71,260 KB
testcase_12 AC 65 ms
71,236 KB
testcase_13 AC 65 ms
71,264 KB
testcase_14 AC 65 ms
71,236 KB
testcase_15 AC 63 ms
71,144 KB
testcase_16 AC 65 ms
71,548 KB
testcase_17 AC 61 ms
71,404 KB
testcase_18 AC 62 ms
71,576 KB
testcase_19 AC 63 ms
71,404 KB
testcase_20 AC 63 ms
71,420 KB
testcase_21 AC 60 ms
71,296 KB
testcase_22 AC 60 ms
71,064 KB
testcase_23 AC 61 ms
71,480 KB
testcase_24 AC 66 ms
76,260 KB
testcase_25 AC 65 ms
76,416 KB
testcase_26 AC 77 ms
76,848 KB
testcase_27 AC 66 ms
75,968 KB
testcase_28 AC 63 ms
75,888 KB
testcase_29 AC 60 ms
71,472 KB
testcase_30 AC 63 ms
76,228 KB
testcase_31 AC 62 ms
71,456 KB
testcase_32 AC 69 ms
76,640 KB
testcase_33 AC 126 ms
100,016 KB
testcase_34 AC 117 ms
89,208 KB
testcase_35 AC 112 ms
98,328 KB
testcase_36 AC 127 ms
100,012 KB
testcase_37 AC 94 ms
89,716 KB
testcase_38 AC 94 ms
91,400 KB
testcase_39 AC 110 ms
89,412 KB
testcase_40 AC 110 ms
89,568 KB
testcase_41 AC 91 ms
93,440 KB
testcase_42 AC 93 ms
85,348 KB
testcase_43 AC 126 ms
100,324 KB
testcase_44 AC 85 ms
85,220 KB
testcase_45 AC 111 ms
100,244 KB
testcase_46 AC 83 ms
80,476 KB
testcase_47 AC 110 ms
91,300 KB
testcase_48 AC 60 ms
71,280 KB
testcase_49 AC 61 ms
71,600 KB
testcase_50 AC 60 ms
71,468 KB
testcase_51 AC 59 ms
71,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, h = map(int, input().split())
if h == 1:
    print('YES')
    exit()
d = {}
p = 2
while p * p <= h:
    cnt = 0
    while h % p == 0:
        cnt += 1
        h //= p
    if cnt:
        d[p] = cnt
    p += 1
if h > 1:
    d[h] = 1
for a in map(int, input().split()):
    if a == 0:
        print('YES')
        exit()
    for p in d:
        while a % p == 0:
            d[p] -= 1
            a //= p
print('YES' if all(v <= 0 for v in  d.values()) else 'NO')
0