結果
問題 | No.2682 Visible Divisible |
ユーザー |
![]() |
提出日時 | 2024-03-20 21:48:03 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 112,640 KB |
最終ジャッジ日時 | 2024-09-30 07:35:43 |
合計ジャッジ時間 | 4,645 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 4 TLE * 1 -- * 9 |
ソースコード
import collectionsdef prime_factorize(n):a = []while n % 2 == 0:a.append(2)n //= 2f = 3while f * f <= n:if n % f == 0:a.append(f)n //= felse:f += 2if n != 1:a.append(n)return aN,K = map(int, input().split())A = list(map(int, input().split()))C = collections.Counter(prime_factorize(K))for k,v in C.items():for a in A:if a%(k**v)==0:breakelse:print('No')exit()print('Yes')