Problem:


Score : 400 points

Problem Statement

Give a pair of integers (A, B) such that A^5-B^5 = X.
It is guaranteed that there exists such a pair for the given integer X.

Constraints

1 \leq X \leq 10^9

X is an integer.

There exists a pair of integers (A, B) satisfying the condition in Problem Statement.

Input

Input is given from Standard Input in the following format:

X

Output

Print A and B, with space in between.
If there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.

A B

Sample Input 1

33

Sample Output 1

2 -1

For A=2 and B=-1, A^5-B^5 = 33.

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
X = int(input())

flag = True
cnt = 0
while flag:
    for i in range(1, 10**9):
        B = (i*-1)**5
        if abs(B) > X:
            break
        if B + X == cnt:
            print(cnt, i*-1)
            flag = False
            break
    cnt += 1

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        divisor = []
        if n % i == 0:
            divisor.append(i)
            divisor.append(n//i)
            divisors.append(divisor)

    # divisors.sort()
    return divisors


X = int(input())
for div in make_divisors(X):
    # b == 0 のとき
    a = div[0]
    right = a**4
    if right == div[1]:
        print(" ".join([str(a), str(0)]))
        exit()
    # a = 0のとき
    b = -div[0]
    right = b**4
    if right == div[1]:
        print(" ".join([str(0), str(b)]))
        exit()
    for b in range(1, 10**9):
        flag = True
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if abs(right) > div[1]:
            flag = False
        if right == div[1]:
            print(" ".join([str(a), str(b)]))
            exit()
        b = -b
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if abs(right) > div[1] and not flag:
            break
        if right == div[1]:
            print(" ".join([str(a), str(b)]))
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
for a in range(-100,100):
  for b in range(-100,100):
    if a**5-b**5==x:
      print(a,b)
      exit()

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        divisor = []
        if n % i == 0:
            divisor.append(i)
            divisor.append(n//i)
            divisors.append(divisor)

    # divisors.sort()
    return divisors


X = int(input())
for div in make_divisors(X):
    b = 0
    a = div[0] + b
    right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
    if right == div[1]:
        print(" ".join([str(a), str(b)]))
        exit()

    for b in range(1, 10**9):
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if right == div[1]:
            print(" ".join([str(a), str(b)]))
            exit()
        b = -b
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if abs(right) > div[1]:
            break
        if right == div[1]:
            print(" ".join([str(a), str(b)]))
            exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors

def lef(a, b):
    return a*a*a*a + a*a*a*b + a*a*b*b + a*b*b*b + b*b*b*b

def solve(X: int):
    divs = make_divisors(X)
    for d in divs:
        upper = X // d
        
        base = 0
        while(lef(base+d,base) < upper):
            base+=1
        if lef(base+d,base) == upper:
            print(base+d,base)
            return

        base = -(d//2)
        while(lef(base+d,base) < upper) and (base > d-1):
            base -= 1
        if lef(base+d, base) == upper:
            print(base+d, base)
            return

        base = -d
        while(lef(base+d,base) < upper) and (base < -(d//2)+1):
            base += 1
        if lef(base+d, base) == upper:
            print(base+d, base)
            return

        base = -d-1
        while(lef(base+d,base) < upper):
            base -= 1
        if lef(base+d, base) == upper:
            print(base+d, base)
            return
    # raise
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-400,400):
  for j in range(-400,400):
    if (i**5)-(j**5)==x:
      print(i,j)
      break

Submission status: Wrong Answer

Solution code:
s = list(map(int,input().split()))
x=s[0]
a=0

for i in range(-118,119):
    for j in range(-118,119):
        a=i**5-j**5
        if a==x:
            print(i,j)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-100,100):
  for j in range(-100,100):
    if (i**5)-(j**5)==x:
      print(i,j)
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(0, 200):
    for b in range(0, -200, -1):
        if a**5 - b**5 == x:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
a,b = 0,0
f = 0
for i in range(int(x**0.2)+1):
    for j in range(int(x**0.2)+1):
        if i**5 - j**5 == x:
            a = i
            b = j
            f = 1
            break
        elif i**5 + j**5 == x:
            a = i
            b = -j
            f = 1
            break
    if f:
        break
print(a,b)

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-100, 101):
    for b in range(-100, 101):
        if pow(a, 5) - pow(b, 5) == x:
            print('{} {}'.format(a, b))
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
X = int(input())
i = 0
while(True):
  A = i ** 5
  B = (abs(A - X)**(1/5))
  if A - X < 0:
    B = -B
  if B % 1 == 0.:
    B = int(B)
    break
  i += 1
print(A, B)

Submission status: Wrong Answer

Solution code:
x = int(input())
a,b = 0,0
for i in range(int(x**0.2)+1):
    for j in range(int(x**0.2)+1):
        if i**5 - j**5 == x:
            a = i
            b = j
            break
        elif i**5 + j**5 == x:
            a = i
            b = -j
            break
print(a,b)

Submission status: Wrong Answer

Solution code:
x = int(input())
a,b = 0,0
for i in range(int(x**0.5)+1):
    if i**5 > x:
        a = i-1
        break
for i in range(int(x**0.5)+1):
    if a**5 - i**5 == x:
        b = i
        break
    elif a**5 + i**5 == x:
        b = -i
        break
print(a,b)

Submission status: Wrong Answer

Solution code:
X=int(input())
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-(j)**5==X:
      print(i,j,sep=" ")
      break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
for a in range(0,x):
    bb = a ** 5 - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    b *= int(bbb.real + bbb.imag)
    if a ** 5 - b ** 5 == x:
        print(a,b)
        break

Submission status: Wrong Answer

Solution code:
X=int(input())
for i in range(-118,120):
  if i**5-(i-1)**5==X:
    print(i,i-1,sep=" ")
    break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
r = math.ceil(math.log(x, 5))
for a in range(-r,r + 1):
    bb = a ** 5 - x
    if bb < 0:
        b = -1
    else:
        b = 1
    bbb = b ** 0.2
    b *= int(bbb.real + bbb.imag)
    if a ** 5 - b ** 5 == x:
        print(a,b)
        break

Submission status: Wrong Answer

Solution code:
x=int(input())

for i in range(-100, 101):
    a=i
    for j in range(-100, 101):
        b=j
        if a**5 -b**5==x:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(-120,120):
    for l in range(-120,120):
        g=i**2
        g=g**2
        g=g*i
        h=l**2
        h=h**2
        h=h**l
        g-=h
        if g==x:
            print('{} {}'.format(i,l))
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-120, 120):
    a5 = a**5
    for b in range(-120, 120):
        if a5 - b**5 == X:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(0, 1000):
  for j in range(1,-1000,-1):
    if (i**5)-(j**5) ==x:
      print(1,j)
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-120, 120):
    for b in range(-120, 120):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
def main():
  x = int(input())

  #-118<=A<=119, -119<=B<=118
  for a in range(-188, 200):
      for b in range(-199, 118):
          if pow(a, 5) - pow(b, 5) == x:
              print(a, b)
              break

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, sqrt
def input(): return sys.stdin.readline().strip()


def main():
    X = int(input())
    x = int(X ** (1/5))
    """
    # ここで丸め誤差が出たせいで数学的にはTrueなものがFalse扱いされていた！！！
    # （例：3125**(1/5) = 5.000000000000001）
    if x == X ** (1/5):
        print("{} {}".format(x, 0))
        return
    # 正しくは以下：
    """
    if x ** 5 == X:
        print("{} {}".format(x, 0))
        return
    
    for B in range(1, x + 1):
        A = (X - B**5) ** (1/5)
        if A < B: break
        if int(A) == A:
            print("{} {}".format(int(A), -B))
            return
    
    y = sqrt(X)
    if int(y) == y:
        upper = int(y) + 1
    else:
        upper = ceil(y)

    for d in range(1, upper):
        if X % d == 0:
            B = 1
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return
            
            e = X // d
            B = 1
            while (B + e) ** 5  < B ** 5 + X:
                B += 1
            if (B + e) ** 5 == B ** 5 + X:
                print("{} {}".format(B + e, B))
                return
       


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-100,100):
    k=fast(i,5)
    for j in range(i,100):
        p=fast(j,5)
        #print(k,p,i,j,p-k)
        if((p-k)==x):
            print(j,i)
            f=1
            break
        elif(k-p==x):
            print(i,j)
            f=1
            break
    if f:
        break

Submission status: Wrong Answer

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
def fast(a,b):
    res=1
    while(b>0):
        if(b&1):
            res*=a
        a*=a    
        b>>=1
    return res
x=ii()
f=0
for i in range(-100,100):
    k=fast(i,5)
    for j in range(i,100):
        p=fast(j,5)
        #print(k,p,i,j,p-k)
        if((p-k)==x):
            print(j,i)
            f=1
            break
    if f:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-100, 101):
    for j in range(-100, 101):
        if i**5 - j**5 == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-63, 64):
    for j in range(-63, 64):
        if i**5 - j**5 == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

# 素数と個数を求める
def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    return res

for a in range(200+1):
# for a in range(-100,100+1):
    a5 = a**5
    # b5 = X - a5
    b5 = a5 - X
    # sign = -1
    sign = 1
    if b5 < 0:
        b5 = -b5
        sign = -1
        # sign = 1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

# 素数と個数を求める
def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            c = 0
            while n%i == 0:
                n /= i
                c += 1
            res.append([i,c])
        i += 1
    return res

# for a in range(200+1):
for a in range(-100,100+1):
    a5 = a**5
    b5 = X - a5
    sign = -1
    if b5 < 0:
        b5 = -b5
        sign = 1

    pc = factorize(b5)

    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            break

    if b**5 == b5:
        print(a, sign*b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

# 素数と個数を求める
def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            # res.append([i,0])
            c = 0
            while n%i == 0:
                n /= i
                c += 1
                # res[-1][1] += 1
            res.append([i,c])
        i += 1
    return res

# res = factorize(7**4*5**3*2**2)
# res = factorize(2**4*5**3*7**2)
# res = factorize(1)
# res = factorize(0)
# print(res)

for a in range(200+1):
    a5 = a**5
    b5 = X - a5
    sign = -1
    if b5 < 0:
        b5 = -b5
        sign = 1

    pc = factorize(b5)

    # ok = True
    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            # ok = False
            break

    if b**5 == b5:
        print(a, sign*b)
        break

    # if ok:
    #     b5 = b**5
    #     if a5-b5 == X:
    #         print(a,b)
    #     elif a5+b5 == X:
    #         print(a,-b)
    #     elif -a5-b5 == X:
    #         print(-a,b)
    #     elif -a5+b5 == X:
    #         print(-a,-b)
    #     break

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-300,301):
  for b in range(-300,301):
    if(a**5-b**5==x):
      print(a,b)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-300,301):
  for b in range(-300,301):
    if(a**5-b**5==x):
      print(a,b)

Submission status: Wrong Answer

Solution code:
import sys, math
x = int(sys.stdin.readline())

L = [i**5 for i in range(100)]
flag = False
for i in range(100):
    for j in range(100):
        if L[i] - L[j]==x:
            print(i, j)
            flag = True
            break
        elif L[i] + L[j]==x:
            print(i, -j)
            flag = True
            break
    if flag ==True:
        break
else:
    print('No')

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            res.append([i,0])
            while n%i == 0:
                n /= i
                res[-1][1] += 1
        i += 1
    return res

# # res = factorize(7**4*5**3*2**2)
# res = factorize(0)
# print(res)

for a in range(200+1):
    a5 = a**5
    b5 = X - a5
    if b5 < 0: b5 = -b5
    pc = factorize(b5)

    ok = True
    b = 1
    if b5 == 0: b = 0
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            ok = False
            break

    if ok:
        b5 = b**5
        if a5-b5 == X:
            print(a,b)
        elif a5+b5 == X:
            print(a,-b)
        elif -a5-b5 == X:
            print(-a,b)
        elif -a5+b5 == X:
            print(-a,-b)
        break

Submission status: Wrong Answer

Solution code:
x=int(input())

for a in range(101):
    aa = pow(a,5) - x
    for b in range(101):
        if aa == pow(b,5):
            print(a,b)
            exit()

        if -aa == pow(b,5):
            print(a,-b)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorize(n):
    res = list()
    i = 2
    while i*i <= n:
        if n%i == 0:
            res.append([i,0])
            while n%i == 0:
                n /= i
                res[-1][1] += 1
        i += 1
    return res

for a in range(200+1):
    a5 = a**5
    b5 = X - a5
    if b5 < 0: b5 = -b5

    pc = factorize(b5)

    ok = True
    b = 1
    for p,c in pc:
        if c == 5:
            b *= p
        else:
            ok = False
            break

    if ok:
        b5 = b**5
        if (a5-b5) == X:
            print(a,b)
        elif (a5+b5) == X:
            print(a,-b)
        elif (-a5-b5) == X:
            print(-a,b)
        elif (-a5+b5) == X:
            print(-a,-b)
        break

Submission status: Wrong Answer

Solution code:
import sys, math
x = int(sys.stdin.readline())

L = [i**5 for i in range(100)]
flag = False
for i in range(100):
    for j in range(100):
        if x == L[i]**5-L[j]**5:
            print(i, j)
            flag = True
            break
        if x == L[i]**5+L[j]**5:
            print(i, -j)
            flag = True
    if flag ==True:
        break

Submission status: Wrong Answer

Solution code:
import collections

X = int(input())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(X))
insu = list(c.keys())
insu.extend([1, X])

flag2 = 1
for i in range(len(insu)):
    flag1 = 1
    a = insu[i] // 2
    while(flag1):
        b = a - insu[i]
        ans = a ** 5 - b ** 5
        if X == ans:
            print(a, b)
            flag2 = 0
            break
        if a > 10:
            flag1 = 0
        a += 1
    if flag2 == 0:
        break

Submission status: Wrong Answer

Solution code:
import sys, math
x = int(sys.stdin.readline())

L = [i**5 for i in range(100)]
flag = False
for i in range(100):
    for j in range(i):
        if x == L[i]**5-L[j]**5:
            print(i, j)
            flag = True
            break
    if flag ==True:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = [0,0]
for i in range(-10,10):
  for j in range(-10,10):
    if i**5 - j**5 == X:
      ans[0] = i
      ans[1] = j
      break

if ans == [9,9] and X != 0:
  for i in range(-100,100):
    for j in range(-100,100):
      if i**5 - j**5 == X:
        ans[0] = i
        ans[1] = j
        break


ans = " ".join(map(str,ans))
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-73,73):
  if(a<0):
    for b in range(-73,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    break
  else:
    for b in range(-73,a):
      if(a**5-b**5==x):
        print(a,b)
        break
    else: continue
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = [0,0]
for i in range(-10,10):
  for j in range(-10,10):
    if i**5 - j**5 == X:
      ans[0] = i
      ans[1] = j
      break

if ans == [9,9] and X != 0:
  for i in range(-100,100):
    for j in range(-100,100):
      if i**5 - j**5 == X:
        ans[0] = i
        ans[1] = j
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
x = int(sys.stdin.readline())

flag = False
for i in range(-100, 100):
    for j in range(-100, 100):
        if i**5-j**5 ==x:
            print(i, j)
            flag = True
            break
    if flag == True:
        break

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    X=I()
    for A in range(-10**5,10**5):
        B_=pow(A,5)-X
        if(B_==0):
            print(A,B_)
            return
        B = int(pow(abs(B_),-5))
        if(B_<0):
            B *= -1
        if(B**5==B_):
            print(A,B)
            return
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

#input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
    x = int(input())
    for a in range(-100,101):
        for b in range(-100,101):
            if(a**5-b**5 == x):
                print(a,b)
                return

main()

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

#input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
    x = int(input())
    for a in range(-10,11):
        for b in range(-10,11):
            if(a**5-b**5 == x):
                print(a,b)
                return

main()

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
for A in range(-10**5,10**5):
    A5 = A ** 5
    if x - A5 < 0:
        B = -1 *round(math.pow(-(x - A5),1/5),0)
    else:
        B = round(math.pow(x - A5,1/5),0)
    if  A5 == x + int(B) ** 5:
        print(A,int(B))
        quit()

Submission status: Wrong Answer

Solution code:
s = int(input())
a = b = 0
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j**5 == s:
      print(i,j)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
f = 1
for A in range(-10**5,10**5):
    A5 = A ** 5
    if x - A5 > 0:
        f = -1
        B = round(math.pow(x - A5,1/5),0)
    else:
        B = round(math.pow(-(x - A5),1/5),0)
    if  A5 == x + B ** 5:
        print(A,int(B)*f)
        quit()

Submission status: Wrong Answer

Solution code:
s = int(input())
a = b = 0
for i in range(0,1000):
  for j in range(-1000,1000):
    if i**5 - j**5 == s:
      print(i,j)
      break

Submission status: Wrong Answer

Solution code:
X = int(input())

a = 0
while True:
    b = a
    target = (a**5) - X
    while (b**5) > target:
        b-=1
    if(b**5) == target:
        print("%d %d",(a,b))
        exit()
    a+=1

Submission status: Wrong Answer

Solution code:
x = int(input())
import math
f = 1
for A in range(0,10**6):
    A5 = A ** 5
    if x - A5 > 0:
        f = -1
        B = int(math.pow(x - A5,1/5))
    else:
        B = int(math.pow(-(x - A5),1/5))

    if B ** 5 + A5 == x:
        print(A,B*f)
        quit()

Submission status: Wrong Answer

Solution code:
from scipy import optimize

X = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

divisors = make_divisors(X)
divisors = divisors + [-x for x in divisors]
for p in divisors:
    def f(x):
        return (x+p)**5 - x**5 - X 
    sol = optimize.fsolve(f, p)
    #print(sol[0])
    B = int(round(sol[0]))
    A = B + p
    #print(p, A, B)
    if A**5 - B**5 == X:
        print(A, B)
        break

Submission status: Wrong Answer

Solution code:
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()

    return False

def solve():
  X = int(input())

  for i in range(round((X**(0.5**5)))):
    ii = i**5
    b = (ii-X)
    # bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if is_integer_num(b):
      return  str(i) +" " + str(b)
      # if ii - b== X:
      #   return str(i) +" " + str(bb)
      # else:
      #   return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()

    return False

def solve():
  X = int(input())

  for i in range(abs(X)):
    ii = i**5
    b = (ii-X)
    # bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if is_integer_num(b):
      return  str(i) +" " + str(b)
      # if ii - b== X:
      #   return str(i) +" " + str(bb)
      # else:
      #   return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())


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

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0

flg = False
p.append([1, 1])
# print(p)
for i in range(len(p)):
    if flg:
        break
    _p = p[i][0]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

Submission status: Wrong Answer

Solution code:
X = int(input())

minus = []
memo = []
i = 0
while i ** 5 < int(1e20):
    minus.append(-i**5)
    memo.append(i**5)
    i += 1

memo = minus + memo


for v in memo:
    tmp = X + v
    tmp2 = pow(tmp,1/5)
    if type(tmp2) != complex and int(tmp2) == tmp2:
        print(int(tmp2),end=" ")
        if v < 0:
            print(-int(pow(-v,1/5)),end=" ")
        else:
            print(int(pow(v,1/5)),end=" ")
        exit()

Submission status: Wrong Answer

Solution code:
#x**5-y**5 - int(input()) = 0


X = int(input()) #X <= 10**9

#x**5-y**5 <= 10**9



count = 0
for l in range(-100,100):
  for i in range(-100,100):
    if(l**5 -i**5 == X):
      print(l,i)
      count += 1
      break
  if(count == 1):
    break

Submission status: Wrong Answer

Solution code:
x = int(input())


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

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0

flg = False
for i in range(len(p)):
    if flg:
        break
    _p = p[i][0]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

Submission status: Wrong Answer

Solution code:
x = int(input())


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

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0

flg = False
for i in range(1):
    if flg:
        break
    _p = p[i][0]
    # print(_p)
    B = int(-_p/2)

    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(B, xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            flg = True
            break

        if xnew > x:
            break

        B += 1


print(f'{Aas} {Bas}')

Submission status: Wrong Answer

Solution code:
import numpy as np
x = int(input())

i = 0
while True:
    a = i
    b = (np.abs(a**5 - x))**(1/5)
    print(b)
    if (a**5-x) < 0 :
        b = -b
    if a**5 - int(b)**5 == x:
        print(a,int(b))
        break
    
    a = -i
    b = (np.abs(a**5 - x))**(1/5)
    if (a**5-x) < 0 :
        b = -b
    if a**5 - int(b)**5 == x:
        print(a,int(b))
        break
    i += 1

Submission status: Wrong Answer

Solution code:
X=int(input())

x=int(X**0.2)+1
for a in range(x):
    for b in range(x):
        A=a**5
        B=b**5
        if X==A-B: print(a,b); exit()
        if X==A+B: print(a,-b); exit()

Submission status: Wrong Answer

Solution code:
# D
import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if int(int(tmp) - tmp) == 0:
        break
        
tmp = int(tmp)
print(tmp, b)

Submission status: Wrong Answer

Solution code:
X=int(input())

for a in range(101):
    for b in range(101):
        A=a**5
        B=b**5
        if X==A+B:
            print(a,-b)
            exit()
        elif X==A-B:
            print(a,b)
            exit()