結果
| 問題 |
No.1224 I hate Sqrt Inequality
|
| コンテスト | |
| ユーザー |
ygd.
|
| 提出日時 | 2020-09-11 22:00:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 620 bytes |
| コンパイル時間 | 404 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 114,944 KB |
| 最終ジャッジ日時 | 2024-12-27 12:35:43 |
| 合計ジャッジ時間 | 22,890 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 1 TLE * 7 |
ソースコード
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")
ygd.