結果

問題 No.1224 I hate Sqrt Inequality
ユーザー 👑 H20H20
提出日時 2021-01-06 09:08:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 554 bytes
コンパイル時間 531 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 76,716 KB
最終ジャッジ日時 2023-09-29 01:58:42
合計ジャッジ時間 2,836 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,696 KB
testcase_01 AC 92 ms
71,920 KB
testcase_02 AC 92 ms
71,664 KB
testcase_03 AC 94 ms
71,832 KB
testcase_04 AC 94 ms
71,772 KB
testcase_05 AC 97 ms
76,620 KB
testcase_06 AC 101 ms
76,544 KB
testcase_07 AC 99 ms
76,596 KB
testcase_08 AC 99 ms
71,564 KB
testcase_09 AC 98 ms
76,716 KB
testcase_10 AC 133 ms
76,520 KB
testcase_11 AC 187 ms
76,552 KB
testcase_12 AC 92 ms
71,772 KB
testcase_13 AC 94 ms
71,672 KB
testcase_14 AC 105 ms
76,448 KB
権限があれば一括ダウンロードができます

ソースコード

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