結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー playerplayer
提出日時 2024-01-15 03:10:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 832 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 59,444 KB
最終ジャッジ日時 2024-01-15 03:10:52
合計ジャッジ時間 5,289 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
55,860 KB
testcase_01 AC 40 ms
55,860 KB
testcase_02 AC 40 ms
55,860 KB
testcase_03 AC 58 ms
59,444 KB
testcase_04 AC 66 ms
59,444 KB
testcase_05 AC 76 ms
59,444 KB
testcase_06 AC 64 ms
59,444 KB
testcase_07 AC 61 ms
59,444 KB
testcase_08 AC 93 ms
59,444 KB
testcase_09 AC 61 ms
59,444 KB
testcase_10 AC 67 ms
59,444 KB
testcase_11 AC 62 ms
59,444 KB
testcase_12 AC 68 ms
59,444 KB
testcase_13 AC 68 ms
59,444 KB
testcase_14 AC 50 ms
59,444 KB
testcase_15 AC 61 ms
59,444 KB
testcase_16 AC 66 ms
59,444 KB
testcase_17 AC 62 ms
59,444 KB
testcase_18 AC 64 ms
59,444 KB
testcase_19 AC 60 ms
59,444 KB
testcase_20 AC 58 ms
59,444 KB
testcase_21 AC 59 ms
59,444 KB
testcase_22 AC 60 ms
59,444 KB
testcase_23 AC 65 ms
59,444 KB
testcase_24 AC 58 ms
59,444 KB
testcase_25 AC 66 ms
59,444 KB
testcase_26 AC 63 ms
59,444 KB
testcase_27 AC 66 ms
59,444 KB
testcase_28 AC 62 ms
59,444 KB
testcase_29 AC 64 ms
59,444 KB
testcase_30 AC 68 ms
59,444 KB
testcase_31 AC 62 ms
59,444 KB
testcase_32 AC 64 ms
59,444 KB
testcase_33 AC 70 ms
59,444 KB
testcase_34 AC 72 ms
59,444 KB
testcase_35 AC 70 ms
59,444 KB
testcase_36 AC 70 ms
59,444 KB
testcase_37 AC 40 ms
55,604 KB
testcase_38 AC 41 ms
55,604 KB
testcase_39 AC 40 ms
55,604 KB
testcase_40 AC 56 ms
59,444 KB
testcase_41 AC 40 ms
55,860 KB
testcase_42 AC 40 ms
55,860 KB
testcase_43 AC 40 ms
55,860 KB
testcase_44 AC 40 ms
55,860 KB
testcase_45 AC 57 ms
59,444 KB
testcase_46 AC 60 ms
59,444 KB
testcase_47 AC 64 ms
59,444 KB
testcase_48 AC 43 ms
59,444 KB
testcase_49 AC 50 ms
59,444 KB
権限があれば一括ダウンロードができます

ソースコード

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:
    if y == 1:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

if y == 1:
    print("Yes")
    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