結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー roaris
提出日時 2021-10-29 21:43:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 82,224 KB
実行使用メモリ 61,452 KB
最終ジャッジ日時 2024-10-07 10:38:22
合計ジャッジ時間 4,665 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

def factorize(n):
    fct = defaultdict(int)
    
    for i in range(2, int(n**0.5)+1):
        c = 0
        
        while n%i==0:
            n //= i
            c += 1
            
        if c>0:
            fct[i] = c
    
    if n>1:
        fct[n] = 1
    
    return fct

X, A, Y, B = map(int, input().split())
fctX = factorize(X)
fctY = factorize(Y)
ok = True

for k in fctY:
    if fctX[k]*A<fctY[k]*B:
        ok = False

if ok:
    print('Yes')
else:
    print('No')
0