結果
問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
ユーザー |
![]() |
提出日時 | 2025-02-01 12:56:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 66 ms / 2,000 ms |
コード長 | 590 bytes |
コンパイル時間 | 449 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 60,924 KB |
最終ジャッジ日時 | 2025-02-01 12:56:43 |
合計ジャッジ時間 | 5,339 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 50 |
ソースコード
import collections def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a def n_fact(N): c = collections.Counter(prime_factorize(N)) return c X,A,Y,B = map(int,input().split()) XP = n_fact(X) YP = n_fact(Y) for k,v in YP.items(): if k not in XP: print("No") exit() if XP[k] * A < v * B: print("No") exit() print("Yes")