結果

問題 No.1224 I hate Sqrt Inequality
ユーザー ygd.ygd.
提出日時 2020-09-11 22:00:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 620 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 80,156 KB
最終ジャッジ日時 2023-08-27 14:28:34
合計ジャッジ時間 4,062 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,956 KB
testcase_01 AC 74 ms
71,692 KB
testcase_02 AC 73 ms
71,516 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    arr = []
    temp = n
    if temp%2 == 0:
      cnt = 0
      while temp%2 == 0:
        cnt += 1
        temp//=2
      arr.append(2)
    for i in range(3, int(-(-n**0.5//1))+1,2):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)
 
    if temp!=1:
        arr.append(temp)
 
    return arr


import math
a,b = map(int,input().split())
G = math.gcd(a,b)
a = a//G
b = b//G

if b == 1:
  print("No");exit()

A = factorization(b)
for x in A:
  if x == 2 or x == 5:
    print("No");exit()
print("Yes")
0