結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー horitaka1999horitaka1999
提出日時 2021-10-29 22:24:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 1,027 bytes
コンパイル時間 181 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 61,188 KB
最終ジャッジ日時 2024-04-16 15:14:39
合計ジャッジ時間 3,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
54,852 KB
testcase_01 AC 41 ms
53,868 KB
testcase_02 AC 43 ms
54,460 KB
testcase_03 AC 47 ms
60,864 KB
testcase_04 AC 59 ms
60,572 KB
testcase_05 AC 49 ms
60,876 KB
testcase_06 AC 46 ms
60,476 KB
testcase_07 AC 46 ms
60,244 KB
testcase_08 AC 48 ms
59,492 KB
testcase_09 AC 46 ms
60,644 KB
testcase_10 AC 50 ms
60,636 KB
testcase_11 AC 46 ms
59,948 KB
testcase_12 AC 47 ms
60,080 KB
testcase_13 AC 45 ms
60,380 KB
testcase_14 AC 45 ms
59,276 KB
testcase_15 AC 65 ms
59,884 KB
testcase_16 AC 50 ms
60,572 KB
testcase_17 AC 66 ms
59,712 KB
testcase_18 AC 55 ms
59,148 KB
testcase_19 AC 50 ms
59,348 KB
testcase_20 AC 48 ms
60,124 KB
testcase_21 AC 55 ms
59,500 KB
testcase_22 AC 49 ms
60,324 KB
testcase_23 AC 49 ms
59,784 KB
testcase_24 AC 45 ms
59,616 KB
testcase_25 AC 55 ms
60,904 KB
testcase_26 AC 49 ms
60,164 KB
testcase_27 AC 44 ms
60,028 KB
testcase_28 AC 57 ms
59,748 KB
testcase_29 AC 54 ms
59,428 KB
testcase_30 AC 62 ms
61,188 KB
testcase_31 AC 54 ms
59,476 KB
testcase_32 AC 47 ms
59,484 KB
testcase_33 AC 43 ms
54,700 KB
testcase_34 AC 42 ms
55,160 KB
testcase_35 AC 42 ms
55,048 KB
testcase_36 AC 72 ms
60,616 KB
testcase_37 AC 42 ms
55,396 KB
testcase_38 AC 42 ms
53,568 KB
testcase_39 AC 42 ms
54,136 KB
testcase_40 AC 42 ms
55,164 KB
testcase_41 AC 42 ms
54,448 KB
testcase_42 AC 42 ms
54,804 KB
testcase_43 AC 42 ms
54,780 KB
testcase_44 AC 41 ms
54,584 KB
testcase_45 AC 42 ms
55,356 KB
testcase_46 AC 43 ms
55,104 KB
testcase_47 AC 43 ms
54,484 KB
testcase_48 AC 43 ms
55,064 KB
testcase_49 AC 44 ms
55,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
X,A,Y,B=map(int,input().split())
class get_prime():#使うたびにクラスの定義が必要。self.revの使い回しNG
    def __init__(self):
        self.rev = []
    def prime(self,n):
        if n == 1:
            return self.rev
        for i in range(2,int(n**0.5)+1):
            if n % i == 0:
                self.rev.append(i)
                self.prime(int(n/i))
                break
        else:
            self.rev.append(n)
        return self.rev
x = get_prime()
y = get_prime()
primeX = x.prime(X)
primeY= y.prime(Y)
dicX = defaultdict(int) 
dicY = defaultdict(int)
for p in primeX:
    dicX[p] += 1
for p in primeY:
    dicY[p] += 1
def check():
    if dicX.keys() >= dicY.keys():
        return True
    else:
        return False
if check():
    flag = True
    for p in dicX.keys():
        if dicX[p] * A >= dicY[p] * B:
            pass
        else:
            flag = False
    if flag:
        print('Yes')
    else:
        print('No')
else:
    print('No')
0