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:
import sys
X = int(input())
MOD = 10**9+7
M = [i for i in range(0, 10**3)]
def function(a, b):
  return ((a**4)%MOD + ((a**3)%MOD * b)%MOD + ((a**2)%MOD * (b**2)%MOD)%MOD + (a * (b**3)%MOD)%MOD + (b**4)%MOD)
for i in M:
  for j in M:
    if i == j:
      continue
    for m in [-1, 1]:
      for n in [-1, 1]:
        if X%(i*m-j*n)==0:
          if function(i*m,j*n)==X//(i*m-j*n):
            print(i*m, j*n)
            sys.exit(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

R = int((X**(1/2))//1)
ans =[0,0]
for i in range(R,0,-1):
  if X % i == 0:
    for j in range(i,-1,-1):
      A = j
      B = A - i
      if A**5 - B**5 == X:
        ans =[A,B]
        break
  
  if ans != [0,0]:
    break


print(ans)

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))
cl = list(c.keys())
cl.append(1)
for insu in cl:
    for i in range(-10000, 10000):
        if i**5 - (i-insu)**5 == X:
            print(i, (i-insu))
            break

Submission status: Wrong Answer

Solution code:
# input
X = int(input())

# process
a, b = 0, 0

nl = []
i = 0
n = i**5
while n <= 10**9:
    nl.append(n)
    i += 1
    n = i**5

ai = 0
for i, n in enumerate(nl):
    if n > X:
        ai = i-1
        break

for i in range(ai, -1, -1):
    t = X-nl[i]
    if t in nl:
        a = i
        b = -(nl.index(X-nl[i]))
        break

    if -t in nl:
        a = i
        b = nl.index(X-nl[i])
        break

# output
print("{} {}".format(a, b))

Submission status: Wrong Answer

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


def solve(X: int):
    # b が負
    for a in range(0, 101):
        for b in range(0, -101, -1):
            if a**5 + b**5 == X:
                print(a, b)
                exit()

    for a in range(0, 121):
        for b in range(0, 120):
            if a**5 + b**5 == X:
                print(a, b)
                exit()

    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:
import math
x = int(input())

def f(a, b):
    return a ** 5 - b ** 5
def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            divisors.append(i)
            # √nで無い数についてもう一個プラス
            if i != n // i:
                divisors.append(n // i)
    return divisors
division = sorted(make_divisors(x))
sele = math.floor(x ** (1/4))
for div in division:
    for j in range(-sele, sele + 1):
        a1 = j
        b1 = div - j
        if f(a1, b1) == x:
            print(a1, b1)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
import collections
x = int(input())
a = b = 0
b = -1
l = [i**5 for i in range(1000)]
if x-1 in l:
    a = l.index(x-1)
elif x in l:
    a = l.index(x-1)
    b = 0
print(a, b)

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
b = []
for i in range(-65,66):
    a.append([i, i**5])
    b.append([i, i**5])

n = len(a)

for i in range(n):
    for j in range(n):
        if a[i][1] - b[j][1] == x:
            print(str(a[i][0]) + " " + str(b[j][0]))
            exit()
        if b[j][1] - a[i][1] == x:
            print(str(b[j][0]) + " " + str(a[i][0]))
            exit()
        if a[j][1] - b[i][1] == x:
            print(str(a[j][0]) + " " + str(b[i][0]))
            exit()
        if b[i][1] - a[j][1] == x:
            print(str(b[i][0]) + " " + str(a[j][0]))
            exit()

Submission status: Wrong Answer

Solution code:
def resolve():
    x = int(input())
    aa = [i**5 for i in range(64)]

    for i in range(len(aa)):
        a = aa[i]
        for j in range(len(aa)):
            b = aa[j]
            if a - b == x:
                print(i,j)
                break
            elif a + b == x:
                print(i,-j)
                break
            elif -a - b == x:
                print(-i, j)
                break
            elif -a + b == x:
                print(-i, -j)
                break
        else:
            continue
        break

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
X = int(input())

gojo = []
i = 0
ans = 0
while ans <= 1000000000:
    ans = i**5
    gojo.append(ans)
    i += 1

risou = 0
for j, gostart in enumerate(gojo):
    risou = gostart + X
    mirisou = X - gostart
    for k in range(j+1,len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou or gojo[k] > mirisou:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

import math

for a in range(1,int(math.sqrt(math.sqrt(x)))+1):
    for b in range(-int(math.sqrt(math.sqrt(x)))+1,int(math.sqrt(math.sqrt(x)))):
        if a!=b:
            if x/(a-b) == a*a*a*a+a*a*a*b+a*a*b*b+a*b*b*b+b*b*b*b:
                print(a,b)
                break

Submission status: Wrong Answer

Solution code:

x=int(input())

anses = set()
i = 0
while True:
    anses.add(i)
    anses.add(-i)
    if i**5 > 10**9:
        break
    i += 1

for a in list(anses):
    for b in list(anses):
        if a**5 - b**5 == x:
            print(a,b)
            exit(0)

Submission status: Wrong Answer

Solution code:
X = int(input())
l = list()
i = int()
while i**5-(i-1)**5 <= 10**9:
    l.append(i**5)
    l.append(0-i**5)
    i += 1
for i in range(len(l)):
    for j in range(i, len(l)):
        if abs(l[i]-l[j])==X:
            if l[i]-l[j]==X:
                A=l[i]
                B=l[j]
            else:
                A=l[j]
                B=l[i]
            A=A**0.2
            B=B**0.2
            print(A, B)
            exit()
#print(l,len(l))

Submission status: Wrong Answer

Solution code:
x = int(input())

def check(i):
    a = 1
    while True:
        b = a - i
        temp = pow(a, 5) - pow(b, 5)
        if temp == x:
            return (a, b)
        if temp > x:
            return -1
        a += 1

num = int(pow(x, 0.5)//1)
for i in range(1, num + 1):
    if x % i == 0:
        temp = check(i)
        temp1 = check(x//i)
        if temp == -1 and temp1 == -1:continue
        else:
            if temp != -1:print(*temp)
            else:print(*temp1)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
from itertools import combinations_with_replacement

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    X = int(rl())
    
    five_pow = [0]
    i = 1
    while five_pow[-1] < 10 ** 10:
        five_pow.append(i ** 5)
        i += 1
    
    for a, b in combinations_with_replacement(range(len(five_pow)), 2):
        p_of_a, p_of_b = five_pow[a], five_pow[b]
        if p_of_a - p_of_b == X:
            print(a, b)
            exit()
        if p_of_a + p_of_b == X:
            print(a, -b)
            exit()


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
X = int(input())

num_list = tuple(x**5 for x in range(101))
for i, a in enumerate(num_list):
    for j, b in enumerate(num_list):
        if a-b == X:
            print(i, j)
            exit(0)
        elif a+b == X:
            print(i, -j)
            exit(0)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

for i in range(1, 10 ** 3 + 11):
    for j in range(-10 ** 2 - 11, 10 ** 2 + 11):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
# python3

#===============================================================================
from collections import defaultdict, Counter
from functools import lru_cache
from heapq import heappush, heappop
from math import gcd, floor, ceil
from sys import stdin, stdout

def ilist():
    return [int(x) for x in stdin.readline().strip().split(" ")]
def iint():
    return int(stdin.readline().strip())
def istr():
    return stdin.readline().strip()
##==============================================================================


def solve(X):
    c = {}
    for i in range(66):
        c[i] = i ** 5
        c[-i] = -c[i]
    for i in c:
        for j in c:
            if c[i] - c[j] == X:
                return str(i) + " " + str(j)


if __name__ == '__main__':
    X = iint()
    print(solve(X))

Submission status: Wrong Answer

Solution code:
import bisect as bi
import collections as cc
I=lambda:list(map(int,input().split()))
x,=I()
ar=[]
i=1
fl=1

t=bi.bisect_left(ar,x)
for i in range(-100,100):
    for j in range(-100,100):
        if (i**5)-(j**5)==x:
            print(i,j)
            fl=0
            break
    if not fl:
        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))
cl = list(c.keys())
cl.append(1)
for insu in cl:
    for i in range(-1000, 1000):
        if i**5 - (i-insu)**5 == X:
            print(i, (i-insu))
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

f5=list()

i=0
while i**5<=10**12+6:
    f5.append(i**5)
    i+=1


for i in range(len(f5)):
    for j in range(len(f5)):
        if f5[i] + f5[j]== x:
            a=i
            b=-j
        if f5[i] - f5[j] == x:
            a=i
            b=-j

print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())
l = list()
i = int()
while i**5-(i-1)**5 <= 10**9:
    l.append(i**5)
    l.append(0-i**5)
    i += 1
for i in range(len(l)):
    for j in range(i, len(l)):
        if abs(l[i]-l[j])==X:
            if l[i]-l[j]==X:
                A=l[i]
                B=l[j]
            else:
                A=l[j]
                B=l[i]
            print(A, B)
            A=A**0.2
            B=B**0.2
            print(A, B)
            exit()
#print(l,len(l))

Submission status: Wrong Answer

Solution code:
x = int(input())
p, q = 0, 0
for a in range(-54, 55):
    for b in range(-54, 55):
        if a**5 - b**5 == x:
            p, q = a, b
print(p, q)

Submission status: Wrong Answer

Solution code:

x=int(input())

a=int(round(x**(1/5),0))
b=(a**5-x)
if b<0:
    b=-int((abs(b)**(1/5)))
else:
    b=int((abs(b)**(1/5)))

print("{} {}".format(a,b))

Submission status: Wrong Answer

Solution code:
X = int(input())

num = [0] * 100
for i in range(len(num)):
    num[i] = i ** 5

for i in range(len(num)):
    for j in range(len(num)):
        if num[i] + num[j] == X:
            print(i, -j)
            exit()
        if num[i] - num[j] == X:
            print(i, j)
            exit()
        if num[j] + num[i] == X:
            print(j, -i)
            exit()
        if num[j] - num[i] == X:
            print(j, i)
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np
x = int(input())
for i in range(65):
    if(i ** 5 -x > 0):
        b = int(pow(i**5-x,1/5))
        if(b**5 == i**5-x):
            print(i,b)
            break
    else:
        b = int(pow(-i**5+x,1/5))
        if(b**5 == -i**5+x):
            print(i,-b)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

def calc(x):
    for i in range(-100, 101):
        for j in range(i+1, 101):
            if ((j**5) - (i**5)) == x:
                print(j, i)
                return
calc(x)

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(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())

from itertools import product
tot_comb = [el for el in product(list(range(-120, 121)), list(range(-120, 121))) if el[0]!=el[1]]
tot_comb += [(0,0)]
num_dict = {el[0]**5 - el[1]**5: el for el in tot_comb}
print(num_dict[x])

Submission status: Wrong Answer

Solution code:
from math import *
x=int(input())
a=0
while 1:
  b=a**5-x
  if b<0: b=-((-b)**.2)
  else: b**=.2
  if b.is_integer():
    print(a,int(b))
    break
  a+=1

Submission status: Wrong Answer

Solution code:
x = int( input() )

for a in range( 101 ):
    for b in range( a + 1 ):
        if a ** 5 + b ** 5 == x:
            print( str( a ) + " " + str( -b ) )
            exit()
        elif a ** 5 - b ** 5 == x:
            print( str( a ) + " " + str( b ) )
            exit()

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
end=0
for i in range(1,63):
    check1=math.pow( i+1, 5 )
    check2=math.pow(i-1,5)
    if check2<x<check1 and 2*pow(i,5)>x:
        break
x=x-pow(i,5)
if x<0:
    x=-x
    end=1
b=int(pow(x,1/5))
if end:
    b=-b
print(i,end=' ')
print(b)

Submission status: Wrong Answer

Solution code:
X = int(input())

A = 0
B = 0
while True:
    a = A**5
    temp = a - X
    if A == 2:
        break
    temp = abs(temp)
    B = temp**(1/5)
    if type(B) != complex:
        if B.is_integer():
            B = int(B)
            break
    A += 1

if A**5 - B**5 == X:
    print(A, B)
else:
    print(A, -B)

Submission status: Wrong Answer

Solution code:
n=int(input())
x= list(range(-100, 100, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()

Submission status: Wrong Answer

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

    for i in range(x):
        b = (x - pow(i, 5)) * -1
        if abs(b) == 1:
            b = pow(b, 5)
        else:
            b = pow(b, 1/5)
        if isinstance(b, int):
            print(i, b)
            exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
a = int(X**0.2) + 1
for i in range(0,a+1):
  for j in range(0,-(a+1),-1):
    if i==0 and j==0:
      continue
    else:
      if X%(i-j) == 0:
        if X == i**5 - j**5:
          print(i,j)
          exit()

Submission status: Wrong Answer

Solution code:
def main():
    paramX = int(input())
    size = 100
    for a in range(size * -1, size):
        for b in range(size * -1, size):
            if pow(a, 5) - pow(b, 5) == paramX:
                print(a, b)
                return
    print(1, 1)
main()

Submission status: Wrong Answer

Solution code:
x = int(input())
A=[a**5 for a in range(500)]
for b in range(10000):
    tmp=x+b**5
    if tmp in A:
        print(A.index(tmp)+1,b)
        exit()
    tmp=x-b**5
    if tmp in A:
        print(A.index(tmp)+1,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(f"{a} {b}")
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(-10**5, 10**5):
    if (x + i**5) < 0:
        flag = '-'
    else:
        flag = '+'
    A_tmp = abs(x + i**5)**(1/5)
    # print("i", i)
    # print(x + i**5)
    # print(A_tmp)
    if A_tmp == int(A_tmp):
        A = int(A_tmp)
        B = i
        if flag == '-':
            A *= -1
        # break
print(str(A) + ' ' + str(B))

Submission status: Wrong Answer

Solution code:
x=int(input())
a=int(pow(x,0.2))
b=-(x-pow(a,5))
print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())

num_list = tuple(x**5 for x in range(41))
for i, a in enumerate(num_list):
    for j, b in enumerate(num_list):
        if a-b == X:
            print(i, j)
            exit(0)
        elif a+b == X:
            print(i, -j)
            exit(0)

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(int(1e9)+1):
    b = a**5 - x
    if b**(1/5).is_integer():
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
def func(n, num):
    cnt = 10**18
    
    for i in range(1, 101):
        if(cnt > abs(n-i**5)):
            cnt = abs(n-i**5)
            num = i
    return num

        
def main():
    X = int(input())
    if(X == 1):
        print(0, -1)
        exit()
    a = func(X, 0)
    if(a**5-X < 0):
        b = abs(a**5-X)
        ans = -1*func(b, 0)
    else:
        b = a**5-X
        ans = func(b, 0)

    print(a, ans)
    
main()

Submission status: Wrong Answer

Solution code:
X = int(input())
res = [0,0]
for B in range(-1*abs(X), abs(X)+1):
  A = pow(B**5 + X, 1/5)
  if type(A) == complex:
    continue
  if A == int(A):
    res[0] = int(A)
    res[1] = B
    break

print(res[0],res[1])

Submission status: Wrong Answer

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

    n = int(x ** .2)
    if n ** 5 == x:
        print(n, 0)
        return
    
    for i in range(1, 100):
        if x - i ** 5 < 0:
            continue
        n = int((x - i ** 5) ** .2)
        if n ** 5 == (x - i ** 5):
            print(i, -n)
            return
    
    for i in range(1, 10000):
        fif = x + i ** 5
        n = int(fif ** .2)
        if n ** 5 == fif:
            print(fif, i)
            return

main()

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
X = int(input().rstrip('\n'))
a = 0
while X>a**5:
  b1 = (X-a**5)
  b = b1**0.2
  if b.is_integer():
    print(a,int(b)*(-1))
    break
  else:
    a +=1
while a**5 >= X:
  b1 = (a**5-X)
  b = b1**0.2
  if b.is_integer():
    print(a,int(b))
    break
  else:
    a +=1

Submission status: Wrong Answer

Solution code:
X = int(input())
C = 0
for i in range(-0000,1000):
	if C == 1:
		break
	for j in range(-0000,1000):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Submission status: Wrong Answer

Solution code:
X=int(input())
ansa=0
ansb=0
for a in range(100):
    b5 = a**5 - X
    sig = False
    if b5 < 0:
        sig = True
        b5 = abs(b5)
    b1 = pow(b5,1/5)
    if isinstance(b1, complex):
        continue
    if b1 == int(b1):
        ansa=a
        ansb=int(b1)
        if sig:
            ansb *= -1
        break
print(ansa,ansb)

Submission status: Wrong Answer

Solution code:
def main():

    from bisect import bisect_left as bl, bisect_right as br, insort
    import sys,heapq,math
    from collections import defaultdict as dd, deque
    def data(): return sys.stdin.readline().strip()
    def mdata(): return list(map(int, data().split()))
    out = sys.stdout.write
    # sys.setrecursionlimit(100000)
    INF = int(1e9)
    mod = int(1e9)+7

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 20000
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:
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
x=int(input())
l=[]
for a in range(-1000,1000):
	for b in range(-1000,1000):
		p=a**5-b**5
		if p==x:
			l.append([a,b])

print(l[0])

Submission status: Wrong Answer

Solution code:
import bisect
x = int(input())


for a in range(-10000, 10000):
    # ubとlbは余裕を持って大きく（小さく）取っておく
    ub = 10000**5
    lb = -10000**5
    while lb + 1 < ub:
        target = (ub+lb)//2
        if (a**5 - target**5 >= x):
            lb = target
        else:
            ub = target
    if a**5 - target**5-x == 0:
        print(a, target)

Submission status: Wrong Answer

Solution code:
n=int(input())
x= list(range(-80, 80, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
a = []
b = []
for i in range(-65,66):
    a.append([i, i**5])
    b.append([i, i**5])

n = len(a)

for i in range(n):
    for j in range(n):
        if a[i][1] - b[j][1] == x:
            print(str(a[i][0]) + " " + str(b[j][0]))
            exit()
        if b[j][1] - a[i][1] == x:
            print(str(b[j][0]) + " " + str(a[i][0]))
            exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
X = int(stdin.readline().strip())

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)
for i in range(len(divisors)):
  gap = divisors[i]
  other = X // gap
  for a in range(10^9):
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break
    a = a*(-1)
    b = a - gap
    if (a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4)==other:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
x = int(input())
#a**5-b**5 = x
#(a-b)*(a**4 + a**3*b + a**2*b**2 + a*b**3 + b**4) = x
for a in range(-10**4, 10**4):
    if (a**5 - x)%1 == 0:
        print(a, a**5 - x)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

all_a = {a ** 5: a for a in range(-100, 100)}

for b_pow, b in all_a.items():
    a_pow = b_pow - x
    if a_pow in all_a:
        print(b, all_a[a_pow])
        exit()

Submission status: Wrong Answer

Solution code:
X = int(input().rstrip('\n'))
a = 0
while X>a**5:
  b1 = (X-a**5)
  b = b1**0.2
  if b.is_integer():
    print(a,int(b)*(-1))
    break
  else:
    a +=1
while a**5 >= X:
  b1 = (a**5-X)
  b = b1**0.2
  print(b)
  if b.is_integer():
    print(a,int(b))
    break
  else:
    a +=1

Submission status: Wrong Answer

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


def main():
    X = int(input())
    check = [i ** 5 for i in range(-100, 100)]
    for i in range(len(check) - 1):
        for j in range(i + 1, len(check)):
            if check[j] - check[i] == X:
                print(j - 100, i - 100)
                return


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 10000
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())
k=x**0.5
a=int(k)
b=int(a**5  +x)
print(a,b)

Submission status: Wrong Answer

Solution code:
import math

def solve():
    powers = []
    n = 0
    c = 0
    while n < (2 * 10 ** 9):
        n = c ** 5
        c += 1
        powers.append(n)
    for p in powers:
        for pp in powers:
            if p - pp == k:
                print(round(p ** (1/5)), round(pp ** (1/5)), sep=" ")
                exit()
            elif p + pp == k:
                print(round(p ** (1/5)), -round(pp ** (1/5)), sep=" ")
                exit()
    return


k = int(input())
solve()

Submission status: Wrong Answer

Solution code:
X=int(input())
for B in range(-10**4,10**4):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

for i in range(0,10000):
    for j in range(0,10000):
        if i!=j and X % abs(i-j) == 0:
            if i**5 - j**5 ==X:
                print(i,j)
                exit()
            if i**5 + j**5 ==X:
                print(i,-j)
                exit()

Submission status: Wrong Answer

Solution code:
x=int(input())

num_list=[]
num=0
while (num**5 - (num-1)**5) <= x:
    num_list.append(num)
    num_list.append(num-num*2)
    num+=1

for i in range(0,len(num_list)):
    for j in range(i+1,len(num_list)):
        if (num_list[i]**5)-(num_list[j]**5)==x:
            print(num_list[i], num_list[j], sep=' ')
            break
        elif (num_list[j]**5)-(num_list[i]**5)==x:
            print(num_list[j], num_list[i], sep=' ')
            break
    break

Submission status: Wrong Answer

Solution code:
x=int(input())
li=[]
ans1=0
ans2=0

for i in range(-100,101):
    if x-(i**5)<0:
        ans1=i-1
        x=x-((i-1)**5)
        break

for j in range(-100,101):
    if x+(j**5)==0:
        ans2=j
        break

print(ans1,ans2)

Submission status: Wrong Answer

Solution code:
x = int(input())

pos_array = []
neg_array = []

idx = 0
num = 0
while num < 10**9:
    num = pow(idx, 5)
    pos_array.append(num)
    idx += 1

idx = 0
num = 0
while num > -10**9 - 1:
    num = pow(idx, 5)
    neg_array.append(num)
    idx -= 1

for i in range(len(pos_array)):
    for j in range(len(pos_array)):
        if pos_array[i] - pos_array[j] == x:
            print("%d %d" % (i, j))
            exit(0)

for i in range(len(pos_array)):
    for j in range(len(neg_array) - 1, -1, -1):
        if pos_array[i] - neg_array[j] == x:
            print("%d %d" % (i, -j))
            exit(0)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys

X = int(input())

L = []
for i in range(1, int(X**0.5)+1,1):
    if X%i==0:
        L.append([i,X//i])

for x,y in L:
    for a in range(x+1):
        b = a-x
        temp = a**4+(a**3)*b+(a**2)*b**2+a*(b**3)+b**4
        if temp==y:
            print(a,b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(0,64):
    for b in range(-64,64):
        if a**5 - b**5 ==x:
            print(str(a)+" "+str(b))
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
if x==1:
    print(0,-1)
    exit()
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n//=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n//=f
        else:
            f+=2
    if n!=1:
        a.append(n)
    return(a)
li=list(set(prime_factorize(x)))
for i in range(len(li)):
    j=li[i]
    k=j//2
    while pow(k,5)-pow(k-j,5)<=x:
        if pow(k,5)-pow(k-j,5)==x:
            print(k,k-j)
            exit()
        else:
            k+=1
    continue

Submission status: Wrong Answer

Solution code:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
n = math.log(x, 5)
a = round(n)
b = round(n)+1

if x-(a**5) == 1: print(a, 1)
elif x-(a**5) == 0: print(a, 0)
elif x-(b**5) == 1: print(b, 1)
elif x-(b**5) == 0:print(b,0)

Submission status: Wrong Answer

Solution code:
n=int(input())
x= list(range(-64, 64, 1))
#print(x)
a = 100
b = 100
for i in x:
    for j in x:
        if i**5-j**5 == n:
            print(i, end=" ")
            print(j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
C = 0
for i in range(-100,100):
	if C == 1:
		break
	for j in range(-100,100):
		if i**5-j**5 == X:
			print(i,j)
			C += 1
			break

Submission status: Wrong Answer

Solution code:
def main():
    paramX = int(input())
    for a in range(-40, 40):
        for b in range(-40, 40):
            if pow(a, 5) - pow(b, 5) == paramX:
                print(a, b)
                return

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(-100,100,1):
    #print(i)
    for j in range(-100,100,1):
        if i**5 - j**5 == x:
            print(i,j)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
X = int( input() )
 
A = 0
B = 0
for i in range(0, 1000):
  for j in range( -1000, 1 ):
    if i**5 - j ** 5 == X:
      A = i
      B = j
      break
print( A, B )

Submission status: Wrong Answer

Solution code:
x = int(input())

n = 1000
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())

d=1
while d*d<=X:
    if X%d!=0:
        d+=1
        continue

    A=1
    while True:
        x=A**5-(A-d)**5
        x2=A**5-(A-X//d)**5

        if x>X and x2>X:
            break
        elif x==X:
            print("{} {}".format(A,A-d))
            exit(0)
        elif x2==X:
            print("{} {}".format(A,A-X//d))
            exit(0)
        A+=1
    
    d+=1