結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー kohei2019kohei2019
提出日時 2023-06-09 16:02:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 786 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 77,088 KB
最終ジャッジ日時 2023-08-30 09:30:24
合計ジャッジ時間 7,894 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,900 KB
testcase_01 AC 92 ms
72,036 KB
testcase_02 AC 97 ms
72,128 KB
testcase_03 AC 115 ms
76,536 KB
testcase_04 AC 125 ms
76,812 KB
testcase_05 AC 119 ms
76,808 KB
testcase_06 AC 124 ms
76,744 KB
testcase_07 AC 119 ms
76,704 KB
testcase_08 AC 127 ms
76,536 KB
testcase_09 AC 117 ms
76,832 KB
testcase_10 AC 123 ms
76,808 KB
testcase_11 AC 120 ms
76,740 KB
testcase_12 AC 127 ms
76,776 KB
testcase_13 AC 124 ms
76,716 KB
testcase_14 AC 102 ms
76,844 KB
testcase_15 AC 117 ms
76,712 KB
testcase_16 AC 121 ms
76,540 KB
testcase_17 AC 118 ms
77,040 KB
testcase_18 AC 124 ms
76,708 KB
testcase_19 AC 116 ms
76,856 KB
testcase_20 AC 114 ms
76,824 KB
testcase_21 AC 118 ms
76,808 KB
testcase_22 AC 120 ms
76,884 KB
testcase_23 AC 123 ms
76,800 KB
testcase_24 AC 114 ms
77,040 KB
testcase_25 AC 124 ms
76,540 KB
testcase_26 AC 122 ms
76,844 KB
testcase_27 AC 122 ms
76,724 KB
testcase_28 AC 119 ms
76,800 KB
testcase_29 AC 121 ms
76,804 KB
testcase_30 AC 125 ms
76,856 KB
testcase_31 AC 120 ms
76,700 KB
testcase_32 AC 122 ms
76,688 KB
testcase_33 AC 128 ms
76,632 KB
testcase_34 AC 125 ms
76,696 KB
testcase_35 AC 127 ms
76,716 KB
testcase_36 AC 133 ms
76,820 KB
testcase_37 AC 92 ms
72,248 KB
testcase_38 AC 91 ms
71,812 KB
testcase_39 AC 93 ms
71,732 KB
testcase_40 AC 113 ms
76,656 KB
testcase_41 AC 92 ms
72,080 KB
testcase_42 AC 92 ms
71,860 KB
testcase_43 AC 92 ms
72,232 KB
testcase_44 AC 90 ms
72,040 KB
testcase_45 AC 110 ms
76,804 KB
testcase_46 AC 118 ms
77,088 KB
testcase_47 AC 124 ms
76,972 KB
testcase_48 AC 99 ms
76,692 KB
testcase_49 AC 105 ms
76,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(N):#素因数分解√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 #[素因数、個数]
import collections
X,A,Y,B = map(int,input().split())

Xarr = factorization(X)
Yarr = factorization(Y)
Xcnt = collections.Counter()
Ycnt = collections.Counter()
for v,a in Xarr:
    Xcnt[v] = a*A
for v,b in Yarr:
    Ycnt[v] = b*B

if Y == 1:
    print('Yes')
    exit()

flag = True
for v,b in Ycnt.items():
    if Xcnt[v] >= b:
        continue
    print('No')
    break
else:
    print('Yes')
0