結果
| 問題 |
No.2682 Visible Divisible
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-03-22 16:34:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 263 ms |
| コンパイル使用メモリ | 81,980 KB |
| 実行使用メモリ | 120,392 KB |
| 最終ジャッジ日時 | 2024-09-30 10:37:08 |
| 合計ジャッジ時間 | 7,142 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 13 |
ソースコード
def factorization(n):
arr = []
temp = n
i=2
while i*i<=n:
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
i+=1
if temp!=1:
arr.append([temp, 1])
return arr
from collections import defaultdict
N,K=map(int,input().split())
A=list(map(int,input().split()))
fk=factorization(K)
dic=defaultdict(int)
for i in range(N):
for a,b in factorization(A[i]):
dic[a]=max(dic[a],b)
for a,b in fk:
if b>dic[a]:
print('No')
exit(0)
print('Yes')
nikoro256