結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー Hydru
提出日時 2021-10-29 21:59:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 59,648 KB
最終ジャッジ日時 2024-10-07 11:12:10
合計ジャッジ時間 3,808 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import exit
from collections import defaultdict
def Prime_factorization(x):
    result=defaultdict(int)
    if x==1:
        result[1]=1
        return result
    i=2
    while(i**2<=x):
        tmp=0
        while(x%i==0):
            tmp+=1
            x//=i
        if tmp>0:
            result[i]=tmp
        i+=1
    if x>1:
        result[x]=1
    return result

x,a,y,b=map(int,input().split())
X=Prime_factorization(x)
Y=Prime_factorization(y)
if Y=={1:1}:
    print("Yes")
    exit()

for q,i in Y.items():
    if X[q]*a<i*b:
        print("No")
        exit()

print("Yes")
0