結果

問題 No.1224 I hate Sqrt Inequality
ユーザー paruf4paruf4
提出日時 2020-09-11 23:02:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 8,288 KB
最終ジャッジ日時 2023-08-27 16:29:07
合計ジャッジ時間 1,084 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,960 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 13 ms
8,288 KB
testcase_03 AC 13 ms
7,872 KB
testcase_04 WA -
testcase_05 AC 13 ms
7,880 KB
testcase_06 AC 13 ms
7,824 KB
testcase_07 AC 14 ms
7,888 KB
testcase_08 WA -
testcase_09 AC 14 ms
7,884 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 13 ms
7,956 KB
testcase_13 AC 13 ms
7,880 KB
testcase_14 AC 14 ms
7,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divcount(n,x):
    res = 0
    while n>0:
        if n%x == 0:
            n //= x
            res += 1
        else:
            break
    return res

a,b = map(int,input().split())

if a%b == 0:
    print("No")
    exit(0)

a2 = divcount(a,2)
a5 = divcount(a,5)
b2 = divcount(b,2)
b5 = divcount(b,5)

a2 = max(a2-b2,0)
b2 = max(b2-a2,0)
a5 = max(a5-b5,0)
b5 = max(b5-a5,0)

a //= 2**a2
a //= 5**a5
b //= 2**b2
b //= 5**b5

if b2 == 0 and b5 == 0 and b != 1:
    print("Yes")
else:
    print("No")


0