結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー irumo8202irumo8202
提出日時 2022-02-01 23:47:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 787 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 8,328 KB
最終ジャッジ日時 2023-09-02 02:37:37
合計ジャッジ時間 6,870 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,776 KB
testcase_01 AC 17 ms
7,864 KB
testcase_02 AC 17 ms
7,972 KB
testcase_03 AC 85 ms
7,832 KB
testcase_04 AC 159 ms
7,828 KB
testcase_05 AC 110 ms
7,968 KB
testcase_06 AC 115 ms
7,812 KB
testcase_07 AC 96 ms
7,856 KB
testcase_08 AC 178 ms
7,952 KB
testcase_09 AC 101 ms
7,796 KB
testcase_10 AC 152 ms
7,920 KB
testcase_11 AC 106 ms
7,812 KB
testcase_12 AC 137 ms
7,840 KB
testcase_13 AC 134 ms
7,848 KB
testcase_14 AC 48 ms
7,848 KB
testcase_15 AC 128 ms
7,852 KB
testcase_16 AC 149 ms
7,828 KB
testcase_17 AC 138 ms
7,916 KB
testcase_18 AC 150 ms
7,972 KB
testcase_19 AC 116 ms
7,800 KB
testcase_20 AC 85 ms
7,812 KB
testcase_21 AC 121 ms
7,884 KB
testcase_22 AC 107 ms
7,848 KB
testcase_23 AC 154 ms
7,828 KB
testcase_24 AC 84 ms
7,904 KB
testcase_25 AC 163 ms
7,808 KB
testcase_26 AC 143 ms
7,868 KB
testcase_27 AC 125 ms
7,800 KB
testcase_28 AC 136 ms
7,812 KB
testcase_29 AC 150 ms
7,952 KB
testcase_30 AC 168 ms
8,004 KB
testcase_31 AC 136 ms
7,848 KB
testcase_32 AC 150 ms
7,864 KB
testcase_33 AC 122 ms
7,812 KB
testcase_34 AC 123 ms
7,836 KB
testcase_35 AC 124 ms
7,852 KB
testcase_36 AC 180 ms
7,848 KB
testcase_37 AC 16 ms
8,328 KB
testcase_38 AC 15 ms
8,220 KB
testcase_39 AC 15 ms
8,132 KB
testcase_40 AC 69 ms
7,864 KB
testcase_41 AC 16 ms
7,888 KB
testcase_42 AC 16 ms
7,864 KB
testcase_43 AC 16 ms
7,816 KB
testcase_44 AC 16 ms
7,852 KB
testcase_45 AC 69 ms
7,936 KB
testcase_46 AC 83 ms
7,812 KB
testcase_47 AC 95 ms
7,980 KB
testcase_48 AC 15 ms
7,776 KB
testcase_49 AC 45 ms
7,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X, A, Y, B = map(int, input().split())
if Y == 1:
    print("Yes")
    exit()


def factorization(n):
    fact = dict()
    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
            fact[i] = cnt

    if temp != 1:
        fact[temp] = 1

    if not fact:
        fact[n] = 1

    return fact


fact_x_power_of_a = {p: cnt * A for p, cnt in factorization(X).items()}
fact_y_power_of_b = {p: cnt * B for p, cnt in factorization(Y).items()}

flg = True
for p in fact_y_power_of_b:
    try:
        if fact_x_power_of_a[p] < fact_y_power_of_b[p]:
            flg = False
    except KeyError:
        flg = False

print("Yes" if flg else "No")
0