結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-23 19:46:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 734 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 8,924 KB
最終ジャッジ日時 2023-09-14 12:49:52
合計ジャッジ時間 7,975 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,744 KB
testcase_01 AC 19 ms
8,756 KB
testcase_02 AC 19 ms
8,744 KB
testcase_03 AC 92 ms
8,860 KB
testcase_04 AC 162 ms
8,752 KB
testcase_05 AC 116 ms
8,724 KB
testcase_06 AC 118 ms
8,748 KB
testcase_07 AC 100 ms
8,852 KB
testcase_08 AC 187 ms
8,772 KB
testcase_09 AC 105 ms
8,764 KB
testcase_10 AC 159 ms
8,872 KB
testcase_11 AC 109 ms
8,744 KB
testcase_12 AC 138 ms
8,816 KB
testcase_13 AC 136 ms
8,860 KB
testcase_14 AC 52 ms
8,860 KB
testcase_15 AC 132 ms
8,924 KB
testcase_16 AC 155 ms
8,816 KB
testcase_17 AC 141 ms
8,800 KB
testcase_18 AC 157 ms
8,776 KB
testcase_19 AC 121 ms
8,860 KB
testcase_20 AC 90 ms
8,860 KB
testcase_21 AC 126 ms
8,772 KB
testcase_22 AC 107 ms
8,720 KB
testcase_23 AC 159 ms
8,872 KB
testcase_24 AC 89 ms
8,752 KB
testcase_25 AC 171 ms
8,848 KB
testcase_26 AC 152 ms
8,872 KB
testcase_27 AC 130 ms
8,744 KB
testcase_28 AC 142 ms
8,744 KB
testcase_29 AC 157 ms
8,868 KB
testcase_30 AC 174 ms
8,748 KB
testcase_31 AC 142 ms
8,860 KB
testcase_32 AC 155 ms
8,864 KB
testcase_33 AC 127 ms
8,908 KB
testcase_34 AC 126 ms
8,852 KB
testcase_35 AC 126 ms
8,868 KB
testcase_36 AC 183 ms
8,712 KB
testcase_37 WA -
testcase_38 AC 19 ms
8,588 KB
testcase_39 WA -
testcase_40 AC 72 ms
8,784 KB
testcase_41 AC 19 ms
8,844 KB
testcase_42 AC 19 ms
8,852 KB
testcase_43 AC 19 ms
8,716 KB
testcase_44 AC 19 ms
8,860 KB
testcase_45 AC 72 ms
8,856 KB
testcase_46 AC 87 ms
8,872 KB
testcase_47 AC 97 ms
8,860 KB
testcase_48 AC 18 ms
8,748 KB
testcase_49 AC 47 ms
8,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
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())
X=factorization(x)
dx=defaultdict(int)
dy=defaultdict(int)
Y=factorization(y)
for key,val in X:
    dx[key]=val*a
for key,val in Y:
    dy[key]=val*b
for key,val in dy.items():
    if key not in dx:
        print('No')
        exit()
    dx[key]-=val
    if dx[key]<0:
        print('No')
        exit()
print('Yes')
0