結果

問題 No.1224 I hate Sqrt Inequality
ユーザー lllllll88938494lllllll88938494
提出日時 2022-01-18 06:02:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 590 bytes
コンパイル時間 408 ms
コンパイル使用メモリ 82,944 KB
実行使用メモリ 57,216 KB
最終ジャッジ日時 2024-05-02 19:18:17
合計ジャッジ時間 1,516 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
51,840 KB
testcase_01 AC 39 ms
51,840 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 43 ms
52,352 KB
testcase_04 WA -
testcase_05 AC 40 ms
52,096 KB
testcase_06 AC 45 ms
57,216 KB
testcase_07 AC 41 ms
51,712 KB
testcase_08 AC 40 ms
52,096 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 41 ms
52,224 KB
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
n,m= map(int,input().split())
def p(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)
    sa=set(a)
    return sa
g=gcd(n,m)
n//=g
m//=g
if m%n != 0:
    sa=p(m)
    if len(sa) == 2:
        a,b =sorted(list(sa))
        if  a == 2  and b == 5:
            print('No')
        else:
            print('Yes')
    else:
        print('Yes')
else:
    print('No')
        
    
    
0