結果

問題 No.1224 I hate Sqrt Inequality
ユーザー H20
提出日時 2021-01-06 09:08:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 921 ms
コンパイル使用メモリ 82,424 KB
実行使用メモリ 60,848 KB
最終ジャッジ日時 2024-07-21 20:44:06
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

A,B = map(int,input().split())

AC = collections.Counter(prime_factorize(A))
BC = collections.Counter(prime_factorize(B))
P = BC-AC
flag = False
for i in P.keys():
    if not (i==2 or i==5):
        flag = True
if flag:
    print('Yes')
else:
    print('No')


0