結果

問題 No.1224 I hate Sqrt Inequality
ユーザー rusa_dkrusa_dk
提出日時 2020-09-11 21:42:01
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 508 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 81,496 KB
最終ジャッジ日時 2023-08-27 13:04:33
合計ジャッジ時間 3,345 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,520 KB
testcase_01 AC 78 ms
71,284 KB
testcase_02 AC 79 ms
71,384 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 76 ms
71,268 KB
testcase_06 RE -
testcase_07 AC 90 ms
77,236 KB
testcase_08 AC 103 ms
81,496 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 78 ms
71,116 KB
testcase_14 RE -
権限があれば一括ダウンロードができます

ソースコード

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