結果
問題 |
No.1250 汝は倍数なりや?
|
ユーザー |
![]() |
提出日時 | 2020-10-09 21:29:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 211 ms |
コンパイル使用メモリ | 82,324 KB |
実行使用メモリ | 82,344 KB |
最終ジャッジ日時 | 2024-07-20 08:48:48 |
合計ジャッジ時間 | 4,041 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 TLE * 1 -- * 30 |
ソースコード
n, h = map(int, input().split()) if h == 1: print('YES') exit() d = {} p = 2 while p * p <= h: cnt = 0 while h % p == 0: cnt += 1 h //= p if cnt: d[p] = cnt p += 1 if h > 1: d[h] = 1 for a in map(int, input().split()): for p in d: while a % p == 0: d[p] -= 1 a //= p print('YES' if all(v <= 0 for v in d.values()) else 'NO')