結果
問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
ユーザー |
|
提出日時 | 2022-02-01 23:45:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 747 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-06-11 09:16:11 |
合計ジャッジ時間 | 7,522 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 48 WA * 2 |
ソースコード
X, A, Y, B = map(int, input().split()) def factorization(n): fact = dict() temp = n for i in range(2, int(-(-(n ** 0.5) // 1)) + 1): if temp % i == 0: cnt = 0 while temp % i == 0: cnt += 1 temp //= i fact[i] = cnt if temp != 1: fact[temp] = 1 if not fact: fact[n] = 1 return fact fact_x_power_of_a = {p: cnt * A for p, cnt in factorization(X).items()} fact_y_power_of_b = {p: cnt * B for p, cnt in factorization(Y).items()} flg = True for p in fact_y_power_of_b: try: if fact_x_power_of_a[p] < fact_y_power_of_b[p]: flg = False except KeyError: flg = False print("Yes" if flg else "No")