結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
![]() |
提出日時 | 2020-10-09 21:25:59 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 527 bytes |
コンパイル時間 | 319 ms |
コンパイル使用メモリ | 81,864 KB |
実行使用メモリ | 82,176 KB |
最終ジャッジ日時 | 2024-07-20 08:20:36 |
合計ジャッジ時間 | 4,346 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 1 -- * 30 |
ソースコード
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())) for x in a: for k in p.keys(): while x % k == 0: p[k] -= 1 x //= k for v in p.values(): if v > 0: print('NO') break else: print('YES')