結果

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

ソースコード

diff #

from collections import Counter

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

X,A,Y,B = map(int,input().split())

c = Counter(prime_factorize(X))

for (k,v) in Counter(prime_factorize(Y)).items():
    if k not in c.keys():exit(print('No'))
    elif c[k]*A<v*B:exit(print('No'))
print('Yes')
0