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:
def factorization(n):
    from collections import Counter
    arr = Counter()
    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[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if len(arr.keys()) == 0 and n != 1:
        arr[n] = 1

    return arr


X = int(input())
arr = factorization(X)
INF = 10 ** 12
if X == 1:
    print(0, -1)
    exit()
    
for p in arr:
    a = 0
    A = pow(a, 5)
    b = a - p
    B = pow(b, 5)
    while A < INF:
        if A - B == X:
            print(a, b)
            exit()
        a += 1
        A = pow(a, 5)
        b = a - p
        B = pow(b, 5)

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)

a, b = 0, 0
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 round(tmp[j].imag) == 0:
            ans.append(int(tmp[j].real))
    for i in range(len(ans)):
        for j in range(len(ans)):
            if i != j:
                tmp = ans[i]**5 - ans[j]**5
                if tmp == X: 
                    a = ans[i]
                    b = ans[j]
                    break

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

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=n**(0.2)
        b=int(n**(0.2))
    else:
        n=0-n
        a=n**(0.2)
        b=int(a**(0.2))
    if abs(a-b)<0.001:
        return True
    else:
        return False

B=0

while True:
    C=X+B**5
    D=X-B**5
    if judgef(C):
        A=C**(0.2)
        break
    elif judgef(D):
        A=C**(0.2)
        B=0-B
        break
    B+=1

print(int(A),'',B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())
B=-1
tmp = X
i=0
flg=0
while True:
    tmp = tmp + B**5
    A = int(tmp**.2)
    if A**5==tmp:
        break
    B -= 1
    tmp = X
    i+=1
    if i>40:
        flg=1
        break
if flg==1:
    A=1
    while True:
        tmp = tmp + A**5
        B = int(tmp**.2)
        if B**5==tmp:
            break
        A += 1
        tmp = X
        
print(A, B)

Submission status: Wrong Answer

Solution code:
X = int(input())
for A in range(65, -65, -1):
    for B in range(-65, 65):
        if (A**5-B**5) > X:
            continue
        if (A**5-B**5) == X:
            print("%d %d"%(A,B))
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
nn = int(pow(n,1/5)) + 1
p = sorted(range(nn),reverse = True)
for i in p:
    b = pow(n - i, 1/5)
    if float.is_integer(b):
        break

print(i,int(-b))

Submission status: Wrong Answer

Solution code:
X = int(input())
i=0
while(True):
  B =  i**5 - X
  if B<0:
    powB = pow(-B,0.2)
    if(float.is_integer(powB)):
      print(i,int(-powB))
      break
  else:
    powB = pow(B,0.2)
    if(float.is_integer(powB)):
      print(i,int(powB))
      break
  B =  (-i)**5 - X
  if B<0:
    powB = pow(-B,0.2)
    if(float.is_integer(powB)):
      print(i,int(-powB))
      break
  else:
    powB = pow(B,0.2)
    if(float.is_integer(powB)):
      print(i,int(powB))
      break
  i+=1

Submission status: Wrong Answer

Solution code:
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table

X = int(input())
prime = prime_decomposition(X)
if(X == 1):
    prime =[1,1]
# print(prime)
primer = [0,0]

f =1
# print(a**4+b**4+a**3*b+a**2*b**2+a*b**3)
for i in range(len(prime)):
    a_b = prime[i]
    c = int(X/a_b)
    # print(a_b,c)
    j = 0
    while all:
        a = j
        b = a - a_b
        # print(a,b,a_b)
        # if(a == 2 or b == -1):
        #     # print(a,b,a_b)
        #     print(a**4+b**4+a**3*b+a**2*b**2+a*b**3,c)
        #     break
        if(a**4+b**4+a**3*b+a**2*b**2+a*b**3==c):
            primer[0]= a
            primer[1]= b
            # print(primer)
            f = 1
            break
        d = 0-a
        e = a_b-d
        # print(d,e)
        if(d**4+e**4+d**3*e+d**2*e**2+d*e**3==c):
            primer[0]= d
            primer[0]= e
            # print(primer)
            f = 1
            break
        j += 1
    if(f == 1):
        break
        
print(primer)

Submission status: Wrong Answer

Solution code:
x=int(input())

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

for i in range(10**5):
  b=(i**5-x)**(1/5)
  if is_integer_num(b)==True:
    print(i,int(b))
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(10**2):
    for b in range(10**2):
        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:
import math
x=int(input())

def calc(x):
    return x ** (1/5)
def calcRev(x):
    return x ** 5

n = int(calc(x))
a = calcRev(n) - x
retn = calcRev(n)
reta = calcRev(a)
ret = retn - reta
if ret == x:
    print(n, a)

Submission status: Wrong Answer

Solution code:
import numpy as np


def solve(vec, is_complex=True):
    dim = len(vec)
    if is_complex:
        A = np.zeros((dim, dim), dtype=complex)
    else:
        A = np.zeros((dim, dim))
    A[np.arange(dim - 1), 1 + np.arange(dim - 1)] = 1
    A[-1, :] = -vec
    ans, vec = np.linalg.eig(A)
    return ans


def make_divisors(n):
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d = n // i
            ans = np.array([((i ** 4) -d)/5, (i ** 3), (i ** 2) * 2, i * 2])
            for x in ans:
                try:
                    if x.is_integer():
                        if x**5-(i-x)**5 == d:
                            ans = [int(x), int(i-x)]
                            return ans
                except:
                    continue
m=int(input())
try:
    print(*make_divisors(m))
except:
    print(1)

Submission status: Wrong Answer

Solution code:
x = int(input())

t = int(x ** (1/5))
for a in range(-t, t + 1):
    for b in range(-t, t + 1):
        if a ** 5 - b ** 5 == x:
            break
        else:
            pass
print("{:0} {:1}".format(a, b))

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(1,101):
    for b in range(-101, 101):
        if a**5 - b**5 == x:
            print("{} {}".format(a,b))
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

flag = 0
for i in range(-63,64):
    for j in range(-63,64):
        if X == i**5 - j**5:
            print(i,j)
            flag = 1
            break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
yes = False

x = int(input())
for i in range(-100,100+1):
    for j in range(-100,100+1):
        if i**5-j**5 == x:
            print(str(i)+" "+str(j))
            yes = True
            break
    if yes:
        break

Submission status: Wrong Answer

Solution code:
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
X = int(input())
A = []
for i in factorization(X):
  for j in range(0,i[1]+1):
    a = i[0]**j
    b = X//a
    if(a<b):
      A.append([a,b])
    else:
      A.append([b,a])
 
A = list(map(list, set(map(tuple, A))))
flag = 0
for i in A:
  r = list(range(0,100000+1))
  for a in r:
    b = a - i[0]
    if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == i[1]:
      print(a,b)
      flag = 1
      break
  if flag==1:
    break
  r = list(range(0,100000+1))
  for a in r:
    b = a - i[1]
    if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == i[0]:
      print(a,b)
      flag = 1
      break
  if flag==1:
    break

Submission status: Wrong Answer

Solution code:
X=int(input())
import numpy as np
t=int(X**(1/5))+10
a=[]
for i in range(t):
    a.append(i**5)


for i in range(t):
    for j in range(i+1,t):
        if a[i]+a[j]==X:
            print(i,-j)
        if a[j]-a[i]==X:
            print(i,j)

Submission status: Wrong Answer

Solution code:
x = int(input())

root = int(x**(0.2))

flag = 0
for i in range(root - 200, root + 200):
    for j in range(-40, root + 200):
        if i!=j:
            if x%(i-j) == 0:
                if i**5-j**5 == x:
                    print(i, j)
                    flag = 1
                    break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
b = -1
a = x + b**5
print(a, b)

Submission status: Wrong Answer

Solution code:
x = input()
for i in range(100):
  for j in range(100):
    if(i**5-j**5 == x):
      print(str(i)+" "+str(j))

Submission status: Wrong Answer

Solution code:
def test2(x):
    t = int(pow((x//2),0.2))
    if(pow(t,5) == x):
        print(t,-t)
        return()
    else:
        j = -int(pow(x,0.2))
        i = int(pow((x + pow(j,5)),0.2))

        print(i,j)
        return()
# for i in range(1,100000):
#     test(i)
#     test2(i)


x = int(input())
test2(x)

Submission status: Wrong Answer

Solution code:
import sys
x = int(sys.stdin.readline())
a = 0
b = 0.2
while not b.is_integer():
  b = a**5 - x
  if b >= 0:
    b = b**(1/5)
  else:
    b = -(abs(b)**(1/5))
  a += 1
print(a-1, int(b))

Submission status: Wrong Answer

Solution code:
X = int(input())


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

    # divisors.sort()
    return divisors


div = sorted(make_divisors(X))

# print(div)
if len(div) == 1:
    A_B = 1
else:
    A_B = div[1]
R = X // A_B
# print(R)
# print(make_divisors(R))

for a in range(10000):
    if a ** 4 - a ** 3 + a ** 2 - a + 1 == R:
        print(a, -1)
        break

Submission status: Wrong Answer

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

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
        break

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

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

# 0, 0
print(0, 0)

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=0,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:
            r=mid
        else:
            l=mid
    
    l,r=-10**18,0
    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())
d = int(X**(1/5))+2	
list = [0]*d
for i in range(d):
  list[i] = i**5
for i in range(d):
  for j in range(i,d):
    if list[j]-list[i] == X:
      print(j,i)
      break
    elif list[i]+list[j] == X:
      print(i,-j)
      break

Submission status: Wrong Answer

Solution code:
import itertools

X = int(input())
nums = []
for i in range(12):
  nums.append(i**5)

comb = itertools.combinations(nums, 2)
ans = 0

for c in comb:
  a,b = c
  if c[0]+c[1] == X:
    print(int(a**(1/5)),int(-b**(1/5)))
  elif -c[0]+c[1] == X:
    print(int(b**(1/5)),int(a**(1/5)))
  elif c[0]-c[1] == X:
    print(int(a**(1/5)),int(b**(1/5)))
  elif -c[0]-c[1] == X:
    print(int(-a**(1/5)),int(b**(1/5)))

Submission status: Wrong Answer

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

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


for number in factorization(x):
  for a in range(round(x/(number[0]**number[1]))):
    b = a - number[0]
    if a**5 - b**5 == x:
      print(a,b)
      break
    elif a**5 - (-b)**5==x:
      print(a,-b)
      break

Submission status: Wrong Answer

Solution code:
X = int(input())
x = 1
while ((x-1)**4)*5 > X:
  x += 1
for i in range(x):
  for j in range(-x, i):
    if i**5-j**5 == X:
      a = [i,j]
      print(*a)

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

a = 0
a5 = 0
while a5 < x:
    a += 1
    a5 = a**5

a -= 1

#print(a**5 - x)

if a**5 - x < 0:
    b = -1 * math.pow(abs(a**5 - x), 1/5)
else:
    b = math.pow(abs(a**5 - x), 1/5)

print(a,int(b))

Submission status: Wrong Answer

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

def main():
    x = int(input())
    p = [0, 1]
    n = [0, -1]
    i = 2
    while p[-1] <= 2*x:
        p.append(pow(i, 5))
        n.append(-pow(i, 5))
        i += 1

    p_ = set(p)
    n_ = set(n)
    for z in p:
        if x - z in n_:
            print(x-z, z)
            print(int(pow(z, 1 / 5)), int(pow(abs(x - z), 1 / 5)))
            return

        if x - z in p_:
            print(int(pow(x - z, 1 / 5)), int(-pow(z, 1 / 5)))
            return

main()

Submission status: Wrong Answer

Solution code:
N = int(input())
t = []
i=0
s=2
ans1 =0
ans2 =0
while (i**5<10**10):
    t.append(i**5)
    i+=1
for j in t:
    if(N + j) in t:
        ans1 = j
        ans2 = N + j
        s = 0
        break
    elif(N-j) in t:
        ans1 = -j
        if(N-j >0):
            ans2 = N - j
            s = 1
            break
        else:
            ans2 = j - N
            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:
x = int(input())
y = []
count1 = 0
flag = 0
for i in range(0, 100):
  y.append(i*i*i*i*i)
for i in y:
  if i == x:
    print("0 -" + str(count1))
    flag = 1
    break;
  count1 += 1
count1 = 0
for i in y:
  if flag == 1:
    break;
  count2 = 0
  for j in y[:count1]:
    y2 = i + j
    y3 = i - j
    if y2 == x:
      print(str(count1) + " -" + str(count2))
      flag = 1
      break;
    if y3 == x:
      print(str(count1) + " " + str(count2))
      flag = 1
      break;
    count2 +=1
  count1 += 1

Submission status: Wrong Answer

Solution code:
def mapint_inp():
    return map(int, input().split())

def intinp():
    return int(input())

X = intinp()

dict_of_5th_p = dict()

i = 0
while True:
    i_5th_p = i**5
    if i_5th_p > X:
        break
    dict_of_5th_p[i] = i_5th_p
    i += 1

ans_A, ans_B = None, None

outf = False
for i in dict_of_5th_p:
    B_5th = dict_of_5th_p[i]
    C = X - B_5th
    for j in dict_of_5th_p:
        if C == dict_of_5th_p[j]:
            ans_A = j
            ans_B = -i
            outf = True
            break
    if outf:
        break

print(ans_A, ans_B)

Submission status: Wrong Answer

Solution code:
X =int(input())
A = 0
B = 0
AA = 0
for i in range(1,X+1):
    A = i **5
    if AA != 0:
        break
    for j in range(0,i):
        B = j **5
        if abs(A-X) == B:
            AA = i
            AB = j
            break
if X - A < 0:
    AB = -AB
print(AA,AB)

Submission status: Wrong Answer

Solution code:
x=int(input())

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

for i in range(10**5):
  b=(i**5-x)**(1/5)
  if is_integer_num(b)==True:
    print(i,int(b))

Submission status: Wrong Answer

Solution code:
x = int(input())

x2 = int(x**0.5)
if x2**5 == x:
  print(x2, 0)
  exit()
elif x2**5-1 == x:
  print(X2, -1)
  exit()

for i in range(1, int(x**0.5)+2):
  if x%i == 0:
    tmp1 = 0
    tmp2 = 0
    a1 = i
    b1 = 0
    a2 = i-1
    b2 = -1
    while abs(tmp1) <= x or abs(tmp2) <= x:
      tmp1 = a1**5 - b1**5
      tmp2 = a2**5 - b2**5
      if tmp1 == x:
        print(a1, b1)
        exit()
      elif tmp2 == x:
        print(a2, b2)
        exit()
      a1+=1
      b1+=1
      a2-=1
      b2-=1

Submission status: Wrong Answer

Solution code:
def test2(x):
    t = int(pow((x//2),0.2))
    if(pow(t,5) == x):
        print(t,-t)
    else:
        j = -int(pow(x,0.2))
        i = int(pow((x + pow(j,5)),0.2))

        print(i,j)
        return()
# for i in range(1,100000):
#     test(i)
#     test2(i)


x = int(input())
test2(x)

Submission status: Wrong Answer

Solution code:
X = int(input())

i = 0
y = 0
S = [0]
a = 0
b = 0

while y == 0:
  i = i + 1
  S.append(i**5)
  if abs(S[i-1]-X) <= abs(S[i]-X):
    y = 1
  
for j in range(len(S)-1):
  if S[i-1] - S[j] == X:
    a = i-1
    b = j
  if S[i-1] + S[j] == X:
    a = i-1
    b = -j

print(a,b)

Submission status: Wrong Answer

Solution code:
x = int(input())

a = [0] * 202

for i in range(-101, 101):
    a[i] = i**5

for i in range(202):
    for j in range(202):
        if a[i] - a[j] == x:
            break
    else:
        continue
    break

if i > 101:
    i = 202 - i
if j > 101:
    j = 202 - j

print("{} {}".format(i, j))

Submission status: Wrong Answer

Solution code:
import numpy as np


def solve(vec, is_complex=True):
    dim = len(vec)
    if is_complex:
        A = np.zeros((dim, dim), dtype=complex)
    else:
        A = np.zeros((dim, dim))
    A[np.arange(dim - 1), 1 + np.arange(dim - 1)] = 1
    A[-1, :] = -vec
    ans, vec = np.linalg.eig(A)
    return ans


def make_divisors(n):
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d = n // i
            ans = np.array([((i ** 4) -d)/5, (i ** 3), (i ** 2) * 2, i * 2])
            for x in ans:
                try:
                    if x.is_integer():
                        if x**5-(i-x)**5 == d:
                            return [int(x), int(i-x)]
                except:
                    continue
m=int(input())
try:
    print(*make_divisors(m))
except:
    print(1)

Submission status: Wrong Answer

Solution code:
X=int(input())

def judgef(n):
    if n>0:
        a=n**(0.2)
        b=int(n**(0.2))
    else:
        n=0-n
        a=n**(0.2)
        b=int(a**(0.2))
    if abs(a-b)<0.0001:
        return True
    else:
        return False

B=0

while True:
    C=X+B**5
    D=X-B**5
    if judgef(C):
        A=C**(0.2)
        break
    elif judgef(D):
        A=C**(0.2)
        B=0-B
        break
    B+=1

print(int(A),'',B)

Submission status: Wrong Answer

Solution code:
import numpy as np


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


x = int(input())
factor = factorization(x)[0][0]
print(f'{factor - 1} {-1}')

Submission status: Wrong Answer

Solution code:
X = int(input())
L = list()
i = 0
while True:
    if i ** 5 > 10 ** 10:
        break
    L.append(i ** 5)
    i += 1
flag = False
ret = ''
for i in range(len(L)):
    if flag:
        break
    for j in range(len(L)):
        if L[i] - L[j] == X :
            ret ='{} {}'.format(i,j)
            flag = True
            break
        if L[i] + L[j] == X :
            ret ='{} {}'.format(i,-j)
            flag = True
            break
print(ret)

Submission status: Wrong Answer

Solution code:
x = int(input())

li = []

for i in range(2,10**5):
    if x%i == 0:
        li.append(i)
        break

li.append(x)


for i in range(10 ** 5):
    for j in li:
        a = i
        b = j - i
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit(0)
        b = i - j
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit(0)

Submission status: Wrong Answer

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

for i in range(1000):
    for j in range(1000):
        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:
x = int(input())
power5 = [(i ** 5) for i in range(100)]
for i in range(100):
  for j in range(100):
    if power5[i] - power5[j] == x:
      print(i, j)
      exit()
for i in range(100):
  for j in range(100):
    if power5[i] + power5[j] == x:
      print(i, -j)
      exit()
for i in range(100):
  for j in range(100):
    if -power5[i] + power5[j] == x:
      print(-i, -j)
      exit()

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 = 0
b = 0
flag = False
for i in range(10**6):
    tmp = ((x + i**5)**(1/5)).real
    if tmp.is_integer():
        b = i
        a = x + b**5
        flag = True
        break
if flag == False:
    for i in range(-10**6,0):
        tmp = ((x + i**5)**(1/5)).real
        if tmp.is_integer():
            b = i
            a = x + b**5
            flag = True
            break
print(int(a),int(b))

Submission status: Wrong Answer

Solution code:


def sovle_odd(X):
    max = 200
    for A in range(1,max, 2):
        for B in range(max):
            AX = A*A*A*A*A
            BX = B*B*B*B*B

            C = AX-BX
            #if AX-BX == X:
            if C == X:
                print(A, B)
                return
            #if BX-AX == X:
            if -C == X:
                print(B, A)
                return
            C = -AX - BX
            #if -AX - BX:
            if C == X:
                print(-A, B)
                return
            #if AX + BX:
            if -C == X:
                print(A, -B)
                return

def solve_even(X):
    max = 500
    for A in range(0,max, 2):
        for B in range(0, max, 2):
            AX = A*A*A*A*A
            BX = B*B*B*B*B

            C = AX-BX
            if C == X:
                print(A,B)
                return
            elif -C == X:
                print(B,A)
                return
            
            C = -AX - BX
            if C==X:
                print(-A,B)
                return
            elif -C==X:
                print(A, -B)
                return

def solve():
    X = int(input())
    
    if X%2==1: # X odd case
        sovle_odd(X)
    else: # X even case
        solve_even(X)

solve()