結果
問題 | No.2682 Visible Divisible |
ユーザー |
![]() |
提出日時 | 2024-03-20 21:50:52 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 664 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 106,996 KB |
最終ジャッジ日時 | 2024-09-30 07:39:18 |
合計ジャッジ時間 | 3,452 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 4 |
ソースコード
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()))if K>10**9:for a in A:if a%K==0:print('Yes')exit()print('No')exit()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')