結果

問題 No.1224 I hate Sqrt Inequality
ユーザー rusa_dk
提出日時 2020-09-11 21:42:01
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 508 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 70,708 KB
最終ジャッジ日時 2024-12-27 08:59:03
合計ジャッジ時間 1,770 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5 RE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_table(n):
  n+=1
  table=[i if i%2 else 2 for i in range(n)]
  for i in range(3,n,2):
    if table[i]==i:
      for j in range(i*i,n,2*i):
        if table[j]==j:
          table[j]=i
  return table


def prime_fact(n,table):
  p=[]
  while n!=1:
    pp=table[n]
    if not(pp==2 or pp==5):
      p.append(pp)
    n//=pp
  return p
def gcd(a,b):
  while b:
    a,b=b,a%b
  return a

a,b=map(int,input().split())
b//=gcd(a,b)
if len(prime_fact(b,prime_table(b))):
  print("Yes")
else:
  print("No")
0