結果

問題 No.1224 I hate Sqrt Inequality
ユーザー GrayCoder
提出日時 2020-09-11 21:51:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 570 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-12-27 11:28:14
合計ジャッジ時間 3,447 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction
from sys import stdin


def prime_factors(n):
    ret = []
    apnd = ret.append
    while n >= 4:
        if n % 2:
            break
        else:
            n //= 2
            apnd(2)
    i = 3
    while n >= i * i:
        if n % i:
            i += 2
        else:
            n //= i
            apnd(i)
    apnd(n)
    return ret


def main():
    input = lambda: stdin.readline()[:-1]
    A, B = map(int, input().split())

    x = Fraction(A, B)
    n = prime_factors(x.denominator)
    for i in n:
        if i not in (2, 5):
            print("Yes")
            break
    else:
        print("No")


main()
0