結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー player
提出日時 2024-01-15 03:01:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 763 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 61,716 KB
最終ジャッジ日時 2024-09-28 02:10:38
合計ジャッジ時間 4,661 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29 WA * 21
権限があれば一括ダウンロードができます

ソースコード

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

xl, yl = factorization(x), factorization(y)

dx,dy = defaultdict(int),defaultdict(int)

for li in xl:
    num,j = li
    dx[num] = j

for li in yl:
    num,j = li
    if dx[num] < j:
        print("No")
        exit()
        
print("Yes")
0