結果
| 問題 |
No.1250 汝は倍数なりや?
|
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2020-10-09 21:26:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 553 bytes |
| コンパイル時間 | 212 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 101,084 KB |
| 最終ジャッジ日時 | 2024-07-20 08:24:24 |
| 合計ジャッジ時間 | 4,837 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 24 WA * 25 |
ソースコード
from collections import Counter
def factorize(n):
a = 2
fct = []
while a * a <= n:
while n % a == 0:
n //= a
fct.append(a)
a += 1
if n > 1:
fct.append(n)
return fct
n, h = map(int, input().split())
p = Counter(factorize(h))
a = list(map(int, input().split()))
keys = p.keys()
for x in a:
for k in keys:
while p[k] == 0 and x % k == 0:
p[k] -= 1
x //= k
for v in p.values():
if v > 0:
print('NO')
break
else:
print('YES')
hir355