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 math

X = int(input())

N = math.ceil(pow(abs(X), 0.2))
M = math.floor(pow(abs(X), 0.2))

a = pow(abs(pow(N, 5) - abs(X)), 0.2)

if a - math.floor(a) < 1e-6:
  a = float(math.floor(a))
if pow(N, 5) - abs(X) < 0:
  a = -a
  
b = pow(abs(pow(M, 5) - abs(X)), 0.2)
if b - math.floor(b) < 1e-10:
  b = float(math.floor(b))

if pow(N, 5) - abs(X) < 0:
  b = -b
  
if a.is_integer() == True and b.is_integer() == True:
  if X < 0:
    print(int(-N), int(-a))
  else:
    print(int(N), int(a))
elif a.is_integer():
  if X < 0:
    print(int(-N), int(-a))
  else:
    print(int(N), int(a))
    
elif b.is_integer():
  if X < 0:
    print(int(-M), int(b))
  else:
    print(int(M), int(-b))

Submission status: Wrong Answer

Solution code:
from math import gcd
import itertools


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)

    return divisors


X = int(input())
s_list = make_divisors(X)
num = len(s_list) // 2
a = s_list[num]
b = X // s_list[num]
ans_A = 0
ans_B = 0
for i, j in itertools.combinations(range(0, 100), 2):
    j *= -1
    if gcd(i**5, a) == gcd(j**5, b):
        ans_A = i
        ans_B = j
        break
if ans_A == 0 and ans_B == 0:
    for i, j in itertools.combinations(range(0, 100), 2):
        if gcd(i**5, a) == gcd(j**5, b):
            ans_A = i
            ans_B = j
            break
print(ans_A, ans_B)

Submission status: Wrong Answer

Solution code:
fives = []
m = {}

i = 0 
while i**5 <= 10**10:
    m[i**5] = i
    m[-1 * i**5] = -1*i
    i+=1
x = int(input())

def fun():
    for i in m.keys():
        for j in m.keys():
            if i-j == x:
                print(str(m[i]) + " " + str(m[j]))
                return

fun()

Submission status: Wrong Answer

Solution code:
import itertools
X=int(input())
li=[i**5 for i in range(1200)]#
for v in itertools.permutations(li, 2):
    v=list(v)
    v.sort()
    if v[0]-v[1]==X:#両方プラスの時
        A=v[0]**0.2
        B=v[1]**0.2
        print(str(int(A))+" "+str(int(B)))
        break
    elif v[0]+v[1]==X:#v[1]がマイナスの時
        A=v[0]**0.2
        B=-1*((v[1])**0.2)
        print(str(int(A))+" "+str(int(B)))
        break
#ans=(i-j)*(i**4+(i**3)*j+(i**2)*(j**2)+i*(j**3)+j**4)
#(ａ－ｂ)(ａ⁴＋ａ³ｂ＋ａ²ｂ²＋ａｂ³＋小さい

Submission status: Wrong Answer

Solution code:
X = int(input())
j = 1
for i in range(1,X//2+2):
  if X%i == 0:
    if i != 1:
      j = i
      break


a_b=j
tmp = X//i
for k in range(-100,100):
  b = -k
  a = a_b + b
  if a**5 - b**5 == X:
    print(a,b)
    exit()

Submission status: Wrong Answer

Solution code:
import sys
readline = sys.stdin.readline
import math

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

def main():
    X = int(readline())
    if X == 1:
        print(0, -1)
        return
    fct = factorize(X)
    if len(fct) == 1:
        fct = [1] + fct
    f1 = fct[0]
    f2 = fct[1]
    ai = math.ceil(f1/2) - 10**4
    bi = ai - f1
    for i in range(2 * 2 * 10**4):
        if ai**4+ai**3*bi+ai**2*bi**2+ai*bi**3+bi**4 == f2:
            print(ai, bi)
            return
        ai += 1
        bi += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

import math


def fact(x):
    for cand in range(2, math.ceil(math.sqrt(x)) + 1):
        q, r = divmod(x, cand)
        if r == 0:
            return min(q, cand), max(q, cand)
    return 1, x


# def check(a, b):
#     a2 = a * a
#     a3 = a2 * a
#     a4 = a3 * a
#     b2 = b * b
#     b3 = b2 * b
#     b4 = b3 * b
#     return a4 + a3*b + a2*b2 + a*b3 + b4

def pow5(x):
    return x ** 5


def func(a, b):
    return pow5(a) - pow5(b)


def submit():
    x = int(input())

    if x == 1:
        print("0 -1")
        return

    q1, q2 = fact(x)
    # パターン1, a, b > 0
    a = 0
    b = -q1
    f = func(a, b)
    while f < x:
        a += 1
        b += 1
        f = func(a, b)
    print("{} {}".format(a, b))


        
submit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X=int(input())
a=list(range(100))
b=list(range(100))
b.extend(list(range(-100,0)))
for i in a:
  for j in b:
    if i**5-j**5==X:
      print(i,j)
      quit()

Submission status: Wrong Answer

Solution code:
x = int(input())

lower = -1
upper = -1
for i in range(100000000):
    pow5 = pow(i, 5)
    if lower == -1 and pow5 >= x:
        lower = i - 1

    if upper == -1 and pow5 - pow(i-1, 5) >= x:
        upper = i
        break

for a in range(lower, upper+1):
    a5 = pow(a, 5)
    for b in range(-a-1, a+1):
        if a5 - pow(b, 5) == x:
            print(a, b)
            exit(0)

# 0, 0
print(0, 0)

Submission status: Wrong Answer

Solution code:
import numpy as np

x = int(input())
f = np.array([-992436543, -916132832, -844596301, -777600000, -714924299, -656356768, -601692057, -550731776, -503284375, -459165024, -418195493, -380204032, -345025251, -312500000, -282475249, -254803968, -229345007, -205962976, -184528125, -164916224, -147008443, -130691232, -115856201, -102400000, -90224199, -79235168, -69343957, -60466176, -52521875, -45435424, -39135393, -33554432, -28629151, -24300000, -20511149, -17210368, -14348907, -11881376, -9765625, -7962624, -6436343, -5153632, -4084101, -3200000, -2476099, -1889568, -1419857, -1048576, -759375, -537824, -371293, -248832, -161051, -100000, -59049, -32768, -16807, -7776, -3125, -1024, -243, -32, -1, 0, 1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543])

for i in range(126):
    for j in range(126):
        if f[i] - f[j] == x:
            print(i - 63, j - 63)
            exit()

Submission status: Wrong Answer

Solution code:
s = set()
table= {}
for i in range(100):
  s.add(i**5)
  table[i**5] = i

x = int(input())
for i in range(100):
  if x-i**5 in s:
    print(i,table[x-i**5])

Submission status: Wrong Answer

Solution code:
N = int(input())


B = -1


import math
#A = math.sqrt(N+B^2)
A = math.pow(N-B^5, 1/5)


print(int(A),B)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

x = int(input())
P = 40000
p = []
b = 0
flag = 0

for i in range(1,P+1):
    if x % i == 0:
        p.append(i)

stop = p[-1]

for i in p:
    a = 0
    while a <= stop:
        b = a - i
        y = (a ** 5) - (b ** 5)
        if y == x:
            print("{} {}".format(a,b))
            flag = 1
            break
        a += 1
    if flag == 1:
        break

Submission status: Wrong Answer

Solution code:
x=int(input())


for b in range(10^9):
  a=(x+b^5)**(1/5)
  if a.is_integer():
    break
    
print(int(a),b)

Submission status: Wrong Answer

Solution code:
import numpy
import math

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

    divisors.sort()
    return divisors

X = int(input())
lis = make_divisors(X)

for i in range(len(lis)):
    Y = lis[i]
    Z = X // Y
    tmp = numpy.roots([5, 10*Y, 10*pow(Y, 2), 5*pow(Y, 3), pow(Y, 4)-Z])
    ans = []
    for j in range(len(tmp)):
        if math.isclose(tmp[j].imag, 0):
            ans.append(int(tmp[j].real))
    if len(ans) == 2:
        ans.sort(reverse=True)
        tmp = ans[0]**5 - ans[1]**5
        if tmp == X: break

print(' '.join(map(str, ans)))

Submission status: Wrong Answer

Solution code:
import math
X=int(input())
divisors=[]

for i in range(1, int(X**0.5)+1):
	if X%i==0:
		divisors.append(i)
		if i!= X//i:
			divisors.append(X//i)
K=len(divisors)

AA=0
BB=0
for y in range(0,K):
	KKK=0
	A=0
	while KKK<X:
		A=A+1
		KKK=A**5-(A-divisors[y])**5
	if KKK==X:
		AA=A
		BB=A-divisors[y]
print(AA,BB)

Submission status: Wrong Answer

Solution code:
x = int(input())
start = int(pow(x,0.2))
for i in range(-start,start):
    k = pow(x + pow(i,5),0.2)
    k = round(k,8)
    if type(k) != type(1+1j) and pow(int(k),5) - pow(i,5) == x:
        print(int(k),i)
        exit()

Submission status: Wrong Answer

Solution code:
x=int(input())

# aが正
count = 0
for a_tmp in range(1, 1000000):
    b_tmp_5 = a_tmp**5 - x
    if b_tmp_5 > 0:
        b_tmp = pow(b_tmp_5, 1/5)
    else:
        b_tmp = (pow(-b_tmp_5, 1/5))*-1
    if b_tmp.is_integer():
        count += 1
        print(a_tmp, int(b_tmp))
        break

# aが負
if count == 0:
    for a_tmp_m in range(-1000, 0):
        b_tmp_5_m = a_tmp_m**5 - x
        b_tmp_m = (pow(-b_tmp_5_m, 1/5))*-1
        if b_tmp_m.is_integer():
            count += 1
            print(a_tmp_m, int(b_tmp_m))
            break

# aが0
if count == 0:
    b_tmp_5_0 = -x
    b_tmp_0 = (pow(-b_tmp_5_0, 1/5))*-1
    if b_tmp_0.is_integer():
        print(0, int(b_tmp_0))

Submission status: Wrong Answer

Solution code:
x = int(input())

break_loop = False
for a in list(map(lambda x: x-64, list(range(131)))):
    for b in list(map(lambda x: x-64, list(range(131)))):
        ans = (a-b)*(a**4 + (a**3)*b + a*a*b*b + a*(b**3) + b**4)
        if x == ans:
            break_loop = True
            print(a,b)
            break
    if break_loop:
        break

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))
    if x == X ** (1/5):
        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
    
    for d in range(1, ceil(sqrt(X))):
        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
            
            d = X // d
            while (B + d) ** 5  < B ** 5 + X:
                B += 1
            if (B + d) ** 5 == B ** 5 + X:
                print("{} {}".format(B + d, B))
                return



if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
x=int(input())
l=[]
for i in range(1,int(x**0.5)+1):
  if x%i==0:
    l.append(i)
    l.append(x//i)
for i in l:
  for j in range(int(i**0.2)+1,0,-1):
    A=j
    B=j-i
    if A**5-B**5==x:
      print(A,B,sep=' ')
      exit()

Submission status: Wrong Answer

Solution code:
def check(x):
    for i in range(-20, 20):
        for j in range(-20, 20):
            if i**5 - j**5 == x:
                print(i, j)
                return

x = int(input())
check(x)

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
S = int(X ** (1/5) + 1)

for i in range(S):
    for j in range(S):
        a = i ** 2
        b = j ** 2
        c = i * j
        if (i - j) * (a * (a ** 2 + c + b) + b * (c + b)) == X:
            print(i,j)
            sys.exit()
        elif (i + j) * (a * (a ** 2 - c + b) + b * (-c + b)) == X:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math

X=int(input())
i_p=0
i_m=0
while True:
    A_p=(X+i_p**5)**(1/5)
    A_m=(X+i_m**5)**(1/5)
    if type(A_p) is not complex:
        A_p=round(A_p,5)
        if A_p==int(A_p):
            A=int(A_p)
            i=i_p
            break
    if type(A_m) is not complex:
        A_p=round(A_p,5)
        if A_m==int(A_m):
            A=int(A_m)
            i=i_m
            break
    i_p+=1
    i_m-=1

print(A,i)

Submission status: Wrong Answer

Solution code:
X=int(input())
x=1
while 1:
  while 1:
    if X%x==0:
      break
    x+=1
  a=X-pow(x,5)
  if a==0:
    print(0,-1)
    exit(0)
  if a%(5*x)==0:
    a=a//(5*x)
    if a>=0:
      for b in range(1,a):
        if a==(b+x)*b*(pow(x,2)+(b+x)*b):
          print(b,b+x)
          exit(0)
    else:
      for b in range(-1,a,-1):
        if a==(b+x)*b*(pow(x,2)+(b+x)*b):
          print(b,b+x)
          exit(0)
  x+=1

Submission status: Wrong Answer

Solution code:
import sys,bisect,string,math,time,functools,random
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            a,b,c=(inp+[1])[:3]
            org_inp.append(inp)
        else:
            index=0
            a,b,c=(ls[i]+[1])[:3]
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)];rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

class Tree:
    def __init__(self,inp_size=None,init=True):
        if init:
            self.stdin(inp_size)
        return

    def stdin(self,inp_size=None):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1)
        return
    
    def listin(self,ls):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls)
        return

    def __str__(self):
        return  str(self.edges)

    def dfs(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append(x)
        v=[-1]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==-1:
                    q.append(nb)
                    v[nb]=func(v[c],nb,d)
        return v

    def EulerTour(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append((-1,x))
        v=[None]*self.size
        v[x]=root_v
        et=[]
        while q:
            cb,ce=q.pop()
            et.append(ce)
            for nb,d in self.edges[ce]:
                if v[nb]==None:
                    q.append((nb,ce))
                    q.append((ce,nb))
                    v[nb]=func(v[ce],nb,d)
        vid=[[-1,-1]for i in range(self.size)]
        for i,j in enumerate(et):
            if vid[j][0]==-1:
                vid[j][0]=i
            else:
                vid[j][1]=i
        return v,et,vid
    
    def LCA_init(self,depth,et):
        self.st=SegTree(self.size*2-1,func=min,ide=inf)
        for i,j in enumerate(et):
            self.st.update(i,j)
        self.LCA_init_stat==True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            depth,et,vid=self.EulerTour(root)
            self.LCA_init(depth,et)
        return self.st.query(x,y+1)

## return prime factors of N as dictionary {prime p:power of p}
## within 2 sec for N = 2*10**20+7
def primeFactor(N):
    i,n=2,N
    ret={}
    d,sq=2,99
    while i<=sq:
        k=0
        while n%i==0:
            n,k,ret[i]=n//i,k+1,k+1
        if k>0 or i==97:
            sq=int(n**(1/2)+0.5)
        if i<4:
            i=i*2-1
        else:
            i,d=i+d,d^6
    if n>1:
        ret[n]=1
    return ret


## return the list of prime numbers in [2,N], using eratosthenes sieve
## within 2sec for N = 1.2*10**7
def PrimeNumSet(N):
    Max = int(N**0.5)
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList:
        if seachList[0] <= Max:
            break
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum

## retrun LCM of numbers in list b
## within 2sec for no of B = 10*5  and  Bi < 10**6
def LCM(b,mo=10**9+7):
    prs=PrimeNumSet(max(b))
    M=dict(zip(prs,[0]*len(prs)))
    for i in b:
        dc=primeFactor(i)
        for j,k in dc.items():
            M[j]=max(M[j],k)
    
    r=1
    for j,k in M.items():
        if k!=0:
            r*=pow(j,k,mo)
            r%=mo
    return r

show_flg=False
show_flg=True

def func(y):
    global x
#    show('d',y)
    
    
    l,r=-10**18-1,10**18+1
    while r-l>1:
        mid=(l+r)//2
        #show((l,r),(mid+y,mid),(mid+y)**5-mid**5)
        if (mid+y)**5-mid**5==x:
            return mid+y,mid
        if (mid+y)**5-mid**5<=x:
            l=mid
        else:
            r=mid
        
    return -1


x=I()
for i in range(1,int(x**0.5)+1+1):
    if x%i==0:
        
        k=func(i)
        if k==-1:
            0
        else:
            print(*k)
            exit()

        k=func(x//i)
        if k==-1:
            0#continue
        else:
            print(*k)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [1, 32, 243, 1024, 3125, 7776, 16807, 32768, 59049, 100000, 161051, 248832, 371293, 537824, 759375, 1048576, 1419857, 1889568, 2476099, 3200000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176, 69343957, 79235168, 90224199, 102400000, 115856201, 130691232, 147008443, 164916224, 184528125, 205962976, 229345007, 254803968, 282475249, 312500000, 345025251, 380204032, 418195493, 459165024, 503284375, 550731776, 601692057, 656356768, 714924299, 777600000, 844596301, 916132832, 992436543]
s = False
for a in range(62, -1, -1):
    for b in range(a, -1, -1):
        if l[a] == x + l[b]:
            print(a+1, b+1)
            s = True
            break
        elif l[a] + l[b] == x:
            print(a+1, -b-1)
            s = True
            break
    if s:
        break

Submission status: Wrong Answer

Solution code:
x=int(input())

#足す場合
max=int(pow(x,0.2))
a=0
b=0
for i in range(0,max+1):
    tmp_b=-1*pow(x-i**5,0.2)
    if int(tmp_b)==tmp_b:
        a=i
        b=int(tmp_b)
        break
print(a,b)

Submission status: Wrong Answer

Solution code:
X = int(input())

#x^5-y^5=(x-y)(x^4+x^3y+x^2y^2+xy^3+y^4)

#for x in range(1, 121):
#  if ((x**5) - ((x-1)**5)) >= 1000000000:
#    print(x)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
n=int(10**9**(1/5))
gojou=[0]*(n+1)
for i in range(n+1):
    gojou[i]=i**5

for i in range(n+1):
    for j in range(n+1):
        if gojou[i]-gojou[j]==x:
            print(i,j)
            break
        elif gojou[i]+gojou[j]==x:
            if i**5 - (-j)**5 == x:
                print(i,-j)
                break
            elif j**5 - (-i)**5==x:
                print(j,-i)
                break
        elif -gojou[i]-gojou[j]==x:
            print(-i,j)
            break
    else:
        continue
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect

D = 4000

X = int(input())

L = [i**5 for i in range(-D, D)]
L2 = [i for i in range(-D, D)]

idx = bisect.bisect_left(L, X)-1

B = L[:idx]
A = L[idx:]

for a in A:
    for b in B:
        if a - b == X:
            break
    else:
        continue
    break

print(L2[L.index(a)], L2[L.index(b)])

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = math.pow(abs(x), 1.0/5.0)
a = math.ceil(y)
b1 = round(math.pow(abs(a^5-x), 1/5))
b2 = round(math.pow(abs((a-1)^5-x), 1/5))
if a^5-b1^5 == x:
    print(a, b1)
elif a^5-b1^5 == -x:
    print(b1, a)
elif (a-1)^5+b2^5 == x:
    print(a-1, -b2)
else:
    print(-b2, a-1)

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 10*5

def blp(dp,num):
    l = 0
    r = len(dp)-1
    while l <= r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:l = mid+1
        else:r = mid-1
    return 0

def bln(dp,num):
    l = 0
    r = len(dp)-1
    while l>=r:
        mid = (l+r)//2
        if num == dp[mid]:return mid
        elif num >= dp[mid]:r = mid+1
        else:l = mid-1
    return 0
            
ap = [i**5 for i in range(n)]
an = [-(i**5) for i in range(n)]

for b in range(-n,n):
    num = x + b**5
    a = max(blp(ap,num),bln(an,num))
    if a:print(a,b) ; break

Submission status: Wrong Answer

Solution code:
N = int(input())
t = []
i=0
s=2
ans1 =0
ans2 =0
while (i**5<=10**9):
    t.append(i**5)
    i+=1
print(t)
for j in t:
    if(N + j) in t:
        ans1 = j
        ans2 = N + j
        s = 0
        break
    elif(N-j) in t:
        ans1 = -j
        ans2 = N - j
        s = 1
        break
if(s==0):
    ans3 = t.index(j) 
    ans4 = t.index(ans2)
else:
    ans3 = (t.index(j))*(-1)
    ans4 = t.index(ans2)
print(ans4,ans3)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))
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 sorted(divisors)



X = ii()
a = make_divisors(X)
ind = bisect.bisect_left(a, X**0.2)
for num in a[:ind+1]:
    for i in range(num):
        j = num - i
        if i**5 + j**5 == X:
            print(i, (-1)*j)
            exit()

Submission status: Wrong Answer

Solution code:
N = int(input())


B = -1


import math
#A = math.sqrt(N+B^2)
A = math.pow(N-1, 1/5)


print(int(A),B)

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(0)

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

X = int(input())
if X == 1:
  print(1,0)
  sys.exit()

tmp = prime_factorize(X)
Xp = tmp[0]
Xpp = X/Xp

a_1 = 5
a_2 = - 10*Xp
a_3 =  10*Xp*Xp
a_4 = - 5*Xp*Xp*Xp
a_5 =  Xp*Xp*Xp*Xp - Xpp

ANS = np.roots([a_1, a_2, a_3, a_4, a_5])

for ans in ANS:
  if ans.imag == 0.0:
    A = int(ans.real)
    B = A - Xp
    if A*A*A*A*A - B*B*B*B*B == X:
      print(A,B)
      sys.exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
t=0
while a**5<x:
    while b**5<x:
        if a**+b**5==x:
            print(a,-b)
            t=1
            break
        if -a**5-b**5==x:
            print(-a,b)
            t=1
            break
        b+=1
    if t==1:
        break
    a+=1

Submission status: Wrong Answer

Solution code:
import bisect
from itertools import combinations

X = int(input())

gojou_list = [i ** 5 for i in range(100)]
X_index = bisect.bisect(gojou_list, X)

start = 0 if X_index < 5 else X_index - 5
end = 80 if X_index + 5 > 80 else X_index + 5

for i, v in combinations(gojou_list, 2):
    i_base = gojou_list.index(i)
    v_base = gojou_list.index(v)
    if i + v != X:
        continue
    if (i * -1) - v == X:
        print(i_base * -1, v_base)

    elif i - (v * -1) == X:
        print(i_base, v_base * -1)

    elif (i * -1) - (v * -1) == X:
        print(i_base * -1, v_base * -1)

    elif i - v == X:
        print(i_base, v_base)

    elif (v * -1) - i == X:
        print(v_base * -1, i_base)

    elif v - (i * -1) == X:
        print(v_base, i_base * -1)

    elif (v * -1) - (i * -1) == X:
        print(v_base * -1, i_base * -1)

    elif v - i == X:
        print(v_base, i_base)

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:
        base = 0
        upper = X // d
        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//2-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
        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:
def resolve():
    x = int(input())
    five = []
    for i in range(-1000, 1001):
        five.append(i ** 5)

    for i in range(len(five)):
        for j in range(len(five)):
            if x == abs(five[i] - five[j]):
                if five[i] >= five[j]:
                    print("{} {}".format(i - 999, j - 999))
                else:
                    print("{} {}".format(j - 999, i - 999))
                    exit()

resolve()

Submission status: Wrong Answer

Solution code:
x = int(input())
def f(a,b):
    return pow(a,4) + b*pow(a,3) + pow(a*b,2) + a*pow(b,3) + pow(b,4)

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

lst = divisor(x)
for y in lst:
    for a in range(10000):
        div = x//y
        
        b = a - y
        if f(a,b) == div:
            print(a, b)
            exit()
            
        b = a + y
        if f(a, b) == div:
            print(a,b)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
if X == 0:
    print(0,0)
    exit()
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()
            if -i**5 + j**5 ==X:
                print(-i,-j)
                exit()
            if - i**5 - j**5 ==X:
                print(-i,j)
                exit()