結果

問題 No.1250 汝は倍数なりや?
ユーザー sangonanasangonana
提出日時 2021-04-08 11:09:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 193 ms / 1,000 ms
コード長 391 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,892 KB
実行使用メモリ 28,880 KB
最終ジャッジ日時 2023-09-05 19:49:31
合計ジャッジ時間 4,614 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,472 KB
testcase_01 AC 20 ms
8,592 KB
testcase_02 AC 18 ms
8,404 KB
testcase_03 AC 18 ms
8,456 KB
testcase_04 AC 19 ms
8,568 KB
testcase_05 AC 19 ms
8,644 KB
testcase_06 AC 18 ms
8,500 KB
testcase_07 AC 18 ms
8,484 KB
testcase_08 AC 18 ms
8,476 KB
testcase_09 AC 18 ms
8,480 KB
testcase_10 AC 18 ms
8,404 KB
testcase_11 AC 18 ms
8,468 KB
testcase_12 AC 18 ms
8,480 KB
testcase_13 AC 18 ms
8,512 KB
testcase_14 AC 17 ms
8,492 KB
testcase_15 AC 19 ms
8,508 KB
testcase_16 AC 19 ms
8,432 KB
testcase_17 AC 19 ms
8,504 KB
testcase_18 AC 19 ms
8,496 KB
testcase_19 AC 19 ms
8,424 KB
testcase_20 AC 18 ms
8,580 KB
testcase_21 AC 18 ms
8,524 KB
testcase_22 AC 19 ms
8,468 KB
testcase_23 AC 19 ms
8,516 KB
testcase_24 AC 19 ms
8,576 KB
testcase_25 AC 19 ms
8,668 KB
testcase_26 AC 19 ms
8,600 KB
testcase_27 AC 20 ms
8,560 KB
testcase_28 AC 18 ms
8,540 KB
testcase_29 AC 19 ms
8,468 KB
testcase_30 AC 19 ms
8,644 KB
testcase_31 AC 19 ms
8,436 KB
testcase_32 AC 19 ms
8,640 KB
testcase_33 AC 191 ms
28,880 KB
testcase_34 AC 124 ms
18,608 KB
testcase_35 AC 149 ms
26,200 KB
testcase_36 AC 193 ms
27,108 KB
testcase_37 AC 98 ms
19,852 KB
testcase_38 AC 107 ms
20,552 KB
testcase_39 AC 117 ms
18,760 KB
testcase_40 AC 117 ms
19,060 KB
testcase_41 AC 108 ms
22,152 KB
testcase_42 AC 80 ms
16,156 KB
testcase_43 AC 149 ms
27,116 KB
testcase_44 AC 73 ms
15,916 KB
testcase_45 AC 161 ms
27,172 KB
testcase_46 AC 64 ms
13,816 KB
testcase_47 AC 117 ms
19,996 KB
testcase_48 AC 18 ms
8,400 KB
testcase_49 AC 18 ms
8,508 KB
testcase_50 AC 18 ms
8,472 KB
testcase_51 AC 18 ms
8,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n,h=map(int,input().split())
a=list(map(int,input().split()))

def prime_list(x):
	i=2
	prime=defaultdict(int)
	while i*i<=x:
		while x%i==0:
			x//=i
			prime[i]+=1
		i+=1
	if x>1:
		prime[x]+=1
	return prime

p=prime_list(h)

for x in a:
	for y in p.keys():
		while p[y]>0 and x%y==0:
			p[y]-=1

if sum(p.values())==0:
	print("YES")
else:
	print("NO")
0