結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー player
提出日時 2024-01-15 03:02:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 765 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 59,520 KB
最終ジャッジ日時 2024-09-28 02:10:44
合計ジャッジ時間 4,466 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 49 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *


def factorization(n):
    arr = []
    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
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


x, a, y, b = map(int, input().split())

if x == 1:
    print("Yes")
    exit()

if y == 1:
    print("No")
    exit()

xl, yl = factorization(x), factorization(y)

dx, dy = defaultdict(int), defaultdict(int)

for li in xl:
    num, j = li
    dx[num] = j * a

for li in yl:
    num, j = li
    if dx[num] < j * b:
        print("No")
        exit()

print("Yes")
0