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())
for i in range(120):
    for j in range(120):
        if (i**5-j**5) == x:
            print(i, j)
        elif (i**5+j**5) == x:
            print(i, -j)
        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
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    flg = 0
    while True:

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

        if xnew > x and B < -_p / 2:
            break

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import floor,ceil,sqrt
import fractions
import collections
import itertools
from collections import deque
X=int(input())
"""
l=[]
for i in range(1,ceil(sqrt(X))+1):
    if X%i==0:
        l.append(i)
        l.append(X//i)
l=list(set(l))
l2=l
for i in range(len(l)):
    l2.append(-l[i])
#print(l2)
l2.sort()
if len(l)!=0:
    for i in l2:
        x=X//i
        #print(i,x)
        n=(x-pow(i,4))/(pow(i,2)+1)
        #print(n)
        if (5*pow(i,4)+20*x)>=0:
            if sqrt((5*pow(i,4)+20*x)).is_integer()==True:
                #print(x,i)
                m=int(sqrt((5*pow(i,4)+20*x)))
                if (-5*i*i+m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
                elif (-5*i*i-m)%10==0:
                    y=(-5*i*i+m)//10
                    #print(i,y)
                    if pow(i,2)+4*y>=0:
                        if sqrt(pow(i,2)+4*y).is_integer()==True:
                            z=int(sqrt(pow(i,2)+4*y))
                            if (-i+z)%2==0:
                                b=(-i+z)//2
                                a=i+b
                                print(a,b)
                                break
                            elif (-i - z) % 2 == 0:
                                b = (-i - z) // 2
                                a = i + b
                                print(a, b)
                                break
"""
flag=0
#こんなことしなくても全探査で通る!
i=0
while pow(i,5)<5*10**8:
    i=i+1
#print(i)
num=i
for i in range(-num-1,num+1):
    for j in range(-num-1,num+1):
        if pow(i,5)-pow(j,5)==X:
            print(i,j)
            flag=1
            break
    if flag==1:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=ansb=0
f=False
m=int(pow(x,0.2))
a=m
while True:
  b=0
  while pow(a,5)-pow(b,5)>=x:
      if pow(a,5)-pow(b,5)!=x:
          b+=1
      else:
          ans=a
          ansb=b
          f=True
          break
  a+=1
  if f or a>200:
      break
if not f:
    f=False
    for a in range(m//2+1):
        for b in range(a,m//2+2):
            if pow(a,5)+pow(b,5)!=x:
                continue
            else:
                ans=a
                ansb=-b
                f=True
                break
        if f:
            break

print(ans,ansb)

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(100):
  for b in range(100):
    for ap in (1,-1):
      for bp in (1,-1):
        if (a * ap) ** 5 - (b * bp) ** 5 == X:
          print(a * ap,b * bp)
          exit(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
ans=ansb=0
f=False
m=int(pow(x,0.2))
a=m
while True:
  b=0
  while pow(a,5)-pow(b,5)>=x:
      if pow(a,5)-pow(b,5)!=x:
          b+=1
      else:
          ans=a
          ansb=b
          f=True
          break
  a+=1
  if f or a>200:
      break
  
else:
    f=False
    for a in range(m//2+1):
        for b in range(a,m//2+2):
            if pow(a,5)+pow(b,5)!=x:
                continue
            else:
                ans=a
                ansb=-b
                f=True
                break
        if f:
            break

print(ans,ansb)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(10):
    d[i**5] = i
# print(d)
f=0
l = list(d.items())
# print(l)
for i in range(len(l)):
    for j in range(len(l)):
        if l[i][0] - l[j][0] == x:
            print(l[i][1],l[j][1])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[i][1] ,- l[j][1])
            f=1
            break
    if f == 1:
        break

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(10):
    d[i**5] = i
# print(d)
f=0
l = list(d.items())
# print(l)
for i in range(len(l)):
    for j in range(len(l)):
        if l[i][0] - l[j][0] == x:
            print(l[i][1],l[j][1])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[j][1] ,- l[i][1])
            f=1
            break
    if f == 1:
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dc
x = int(input())
d = dc(lambda:0)
for i in range(10):
    d[i**5] = i
# print(d)
f=0
l = list(d.items())
# print(l)
for i in range(len(l)-1):
    for j in range(i,len(l)):
        if l[i][0] - l[j][0] == x:
            print(l[i][1],l[j][1])
            f=1
            break 
        elif l[i][0] + l[j][0] == x:
            print(l[j][1] ,- l[i][1])
            f=1
            break
    if f == 1:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(10 ** 9):
  b = abs(a ** 5 - X)
  if float.is_integer(b ** (1/5)):
    b = int(b ** (1/5))
    if a ** 5 < X:
      b = -b
    print(a,b)
    break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
res = round(math.exp((math.log(x))/5))
print(res, res**5-x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import random

X = int(input())
x = 0
y = 0
while(1):
  x = random.randint(-10000, 100000)
  y = random.randint(-10000, 100000)
  if x^5 - y^5 == X:
      break  
print(x, end=" ")
print(y)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-nn,nn):
    cheak = i ** 5 - n
    ans = float(pow(Decimal(abs(cheak)), Decimal("0.2")))

    if type(ans) is float:

        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
from math import ceil, sqrt
import sys
x = int(input())
# x = a**5 - b**5
# a**5 - b**5 = (a − b)(a**4 + a**3b + a**2b**2 + ab**3 + b**4)
def get_factors(n):
  set_factors = {n}
  q = n
  for i in range(1, ceil(sqrt(n))):
    if q%i == 0:
      set_factors.add(i)
      q = q//i
    if q<=1: return set_factors
  return set_factors
all_factors = get_factors(x)
def test_factor(factor):
  upper = sys.maxsize
  lower = 0
  if lower**5-(lower**5-factor)**5 == x:
    return (lower, lower-factor)
  exit_counter = 0
  while exit_counter < 11:
    a = (upper+lower)//2
    ans = a**5-(a-factor)**5
    if ans == x: return (a, a-factor)
    if a**5-(a-factor)**5 < x:
      lower = a
    else:
      upper = a
    if upper**5-(upper-factor)**5 == x: return (upper, upper-factor)
    if upper-lower<=1: exit_counter += 1
  return None
for factor in all_factors:
  result = test_factor(factor)
  if result!=None:
    print(result[0], result[1])
    break

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dc

x = int(input())

d = dc(lambda:0)

for i in range(200):
    ans = i**5
    d[i] = ans

# print(d)
f=0
for i in range(len(d)-1):
    for j in range(i,len(d)):
        if d[j] - d[i] == x:
            print(d[j],d[i])
            f=1
            break 

        elif d[j] + d[i] == x:
            print(d[j],- d[i])
            f=1
            break

    if f == 1:
        break

Submission status: Wrong Answer

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

    a = [i**5 for i in range(1000)]
    for i in range(1000):
        for j in range(i+1, 1000):
            if a[i] - a[j] == n:
                print(j, i)
                return
            if a[j] + a[i] == n:
                print(j, -i)
                return

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dc

x = int(input())

d = dc(lambda:0)

for i in range(200):
    ans = i**5
    d[i] = ans

# print(d)
f=0
for i in range(len(d)-1):
    for j in range(i,len(d)):
        if d[i] - d[j] == x:
            print(d[i],d[j])
            f=1
            break 

        elif d[i] + d[j] == x:
            print(d[i],- d[j])
            f=1
            break

    if f == 1:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(-118,120):
  for j in range(-119,129):
    if i**5 - j**5 == x:
      print(i, j)

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    LIST = [i ** 5 for i in range(1001)]

    for a in range(1001):
        for b in range(a + 1, 1001):
            if LIST[a] - LIST[b] == X:
                print(a, b)
                exit()
            if LIST[a] + LIST[b] == X:
                print(a, -b)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(-118,120):
  for j in range(-119,129):
    if math.pow(i, 5) - math.pow(j, 5) == x:
      print(i, j)
      exit

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    LIST = [i ** 5 for i in range(1001)]

    for i in range(1001):
        for j in range(i + 1, 1001):
            if LIST[i] - LIST[j] == X:
                print(i, -j)
                exit()
            if LIST[i] + LIST[j] == X:
                print(i, j)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(-118, 120):
    for B in range(-119, 129):
        if A ** 5 - B ** 5 == X:
            print(A, B)
            break

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    LIST = [i ** 5 for i in range(1001)]

    for i in range(1001):
        for j in range(i + 1, 1001):
            if LIST[i] - LIST[j] == X:
                print(i, j)
                exit()
            if LIST[i] + LIST[j] == X:
                print(i, -j)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

found = False
for i in range(1, int(X**0.5)+1):
    if X % i == 0:
        a = 0
        b = a - i
        a2 = -1 * a
        b2 = a2 - int(X / i)
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a2 - int(X / i)
            
        if found:
            break
            
    if X % i == 0:
        a = 0
        b = a - int(X / i)
        a2 = -1 * a
        b2 = a2 - int(X / i)
        
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a2 - int(X / i)
            
        if found:
            break

Submission status: Wrong Answer

Solution code:
def resolve():
  X= int(input())

  for A in range(-118, 119):
    for B in range(-118, 119):
      if A**5 - B**5 == X:
        print("{0} {1}".format(A, B))
        return True

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
X = int(input())

found = False
for i in range(1, int(X**0.5)+1):
    if X % i == 0:
        a = 0
        b = a - i
        a2 = -1 * a
        b2 = a2 - i
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a2 - i
            
        if found:
            break
            
    if X % i == 0:
        a = 0
        b = a - int(X / i)
        a2 = -1 * a
        b2 = a2 - i
        
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a2 - i
            
        if found:
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

found = False
for i in range(1, int(X**0.5)+1):
    if X % i == 0:
        a = 0
        b = a - i
        a2 = -1 * a
        b2 = a - i
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a - i
            
        if found:
            break
            
    if X % i == 0:
        a = 0
        b = a - int(X / i)
        a2 = -1 * a
        b2 = a - i
        
        while (1 <= a**5 - b**5 <= 10**9) or (1 <= a2**5 - b2**5 <= 10**9):
            if a**5 - b**5 == X:
                print(a, b)
                found = True
                break
            if a2**5 - b2**5 == X:
                print(a2, b2)
                found = True
                break
            a += 1
            b = a - i
            a2 = -1 * a
            b2 = a - i
            
        if found:
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
C= [i**5 for i in range(1000)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            break
        elif C[a] - C[b] == X:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
X = int(input())
C= [i**5 for i in range(1000)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
        elif C[a] - C[b] == X:
            print(a, b)

Submission status: Wrong Answer

Solution code:
X = int(input())
C= [i**5 for i in range(119)]

a = 0
b = 0

for a in range(len(C)):
    for b in range(len(C)):
        if C[a] + C[b] == X:
            print(a, -b)
            exit(0)
        elif C[a] - C[b] == X:
            print(a, b)
            exit(0)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(-120,120):
    cheak = i ** 5 - n
    ans = pow(abs(cheak), 1/5)
    if type(ans) is float:
        if ans.is_integer():
            if cheak < 0:
                b = -1 * ans
            else:
                b = ans
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e18)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1
for i in range(1,64):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(b2)!=None:
        print(hashmap[b2],-i)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
d = {}
for a in range(-200, 200):
    for b in range(-200, 200):
        k = a**5 - b**5
        d[k] = [a, b]
print(*d[k])

Submission status: Wrong Answer

Solution code:
x = int(input())
d = {}
for a in range(-200, 200):
    for b in range(-200, 200):
        k = a**5 - b**5
        d[k] = (a, b)
print(d[x])

Submission status: Wrong Answer

Solution code:
x=int(input())
value=0
index=0
hashmap=dict()
while value<int(1e9)+1:
    value=pow(index,5)
    hashmap[value]=index
    index+=1
#print(hashmap)    
 
for i in range(1,1000):
    b1=x+int(pow(i,5))
    b2=x+int(pow(-i,5))
    if hashmap.get(b1)!=None:
        print(hashmap[b1],i)
        break
    if hashmap.get(abs(b2))!=None:
        print(hashmap[abs(b2)],-i)
        break

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(str(A) + " " + str(B))
    break  
  break

Submission status: Wrong Answer

Solution code:
x = int(input())

f = False
for a in range(0, 101):
    for b in range(-100, 101):
        if a**5-b**5==x:
            print("{0} {1}".format(a, b))
            f = True
            break
    if f:
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

def make_div(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 f(x, y):
  return x**5 - y**5

Flag = True

for A in range(-100, 100):
  if Flag:
    for i in make_div(X):
      B = A - i
      if f(A, B) == X:
        print(A, B)
        Flag = False
        break
  else:
    break

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)
            break
    else:
        continue
    break

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:
n = int(input())

for i in range(-120,120):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(cheak), 1/5)
    else:
        b = pow((cheak), 1/5)
    if type(b) is float:
        if b.is_integer():
            print(i,int(b))
            break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-200, 200):
  for b in range(-200, 200):
    n = a**5 - b**5
    if n == x:
      print(f'{a} {b}')
      break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(cheak), 1/5)
    else:
        b = pow((cheak), 1/5)
    if type(b) is float:
        if b.is_integer():
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
def main(x):
  for i in range(-120,120):
    for j in range(-120,120):
      if(i**5-j**5 == x):
        print(str(i)+" "+str(j))
        return
 
if __name__ == '__main__':
  main(input())

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = False
for a in range(-100,100):
    for b in range(-100,100):
        if a**5 - b**5 == X:
            print("{0} {1}".format(a,b))
            flag = True
            break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 200
a = [i for i in range(n)]
a5 = [pow(i, 5) for i in range(n)]
for i in range(n):
    for j in range(n):
        if a5[i] - a5[j] == x:
            print(f"{a[i]} {a[j]}")
            exit()
        if a5[i] + a5[j] == x:
            print(f"{a[i]} {-a[j]}")
            exit()
        if a5[j] - a5[i] == x:
            print(f"{-a[i]} {a[j]}")
            exit()
        if a5[j] + a5[i] == x:
            print(f"{-a[i]} {-a[j]}")
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())
c = 0
for a in range(-118, 119):
  for b in range(-118, 119):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      print(A, B)
      c = 1
      break
  if c ==1:
    break

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math

X = int(input())

x = int(math.sqrt(X) + 1)

# ａ⁵－ｂ⁵＝(ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋ｂ⁴)
# a - b >= 1
# a != b


a5 = []
for i in range(100):
    a5.append(i ** 5)

b5 = []
for j in range(100):
    b5.append(j ** 5)

ans_a = 0
ans_b = 0

for a in a5:
    for b in b5:
        if a - b == X:
            print("%d %d" % (a5.index(a), b5.index(b)))
            sys.exit()
        elif a + b == X:
            print("%d %d" % (a5.index(a), -1 * b5.index(b)))
            sys.exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 1
for i in range(-nn,nn):
    cheak = i ** 5 - n
    if cheak < 0:
        b = -1 * pow(abs(i ** 5 - n), 1/5)
    else:
        b = pow((i ** 5 - n), 1/5)
    if type(b) is float:
        if b.is_integer():
            print(i,int(b))
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-200,201):
  for b in range(-200,201):
    if (a**5-b**5==x):
      print(a,b,sep= ' ')
      break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(-130, 130):
    for j in range(-130, 130):
        if X == i ** 5 + j ** 5:
            print(i, j)

Submission status: Wrong Answer

Solution code:
X = int(input())
c = 0
for a in range(-118, 119):
  for b in range(-118, 119):
    Y = a ** 5 - b ** 5
    if Y == X:
      A = a
      B = b
      print(A, B)
      c = 1
      break
    if c ==1:
      break

Submission status: Wrong Answer

Solution code:
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 main():
  X = int(input())

  for i in make_divisors(X):
    for b in range(X):
      if (b + i) ^ 5 - b ^ 5 - X == 0:
        print(b+i, b)
        break
    break



if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
#N, K = (int(i) for i in input().split())
#B = [int(x) for x in stdin.readline().rstrip().split()]
#A = [[int(i) for i in input().split()] for i in range(N)]

X = int(input())

for i in range(120):
    res = X + i**5
    p = res ** (1/5)
    if isinstance(p, float):
        if p.is_integer():
            print(int(p), i)
            exit()
    res = X + (-i**5)
    p = res ** (1/5)
    if isinstance(p, float):
        if p.is_integer():
            print(int(p), -i)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
def f(x):
    N = -1000
    for a in range(-N, N+1):
        A = a**5
        B = A-x
        for j in range(-N, N+1):
            if j ** 5 == B:
                print(a, j)
                return 
x, = map(int, input().split())
f(x)

Submission status: Wrong Answer

Solution code:
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

X=int(input())
a=make_divisors(X)
check=0
test=0
print(a)
for i in range(len(a)):
    if check==1:
        break
    Y = a[i]
    for j in range(1,2*Y+1):
        A = j
        B = A-Y
        if (A-B)*( A**4 + (A**3)*B + (A**2)*(B**2) + (A)*(B**3) + B**4 )==X:
            print(A,' ',B)
            check=1
            break