Problem:


Score : 400 points

Problem Statement

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

Constraints

1 \leq X \leq 10^9

X is an integer.

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

Input

Input is given from Standard Input in the following format:

X

Output

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

A B

Sample Input 1

33

Sample Output 1

2 -1

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

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
x=int(input())

# aが正
count = 0
for a_tmp in range(1, 10000000):
    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:
from math import floor
x = int(input())
k = 1
for i in range(2,x+1):
    if x % i == 0:
        k = i
        break

for a in range(floor((x-1) ** (1/5)),x):
    b = a - k
    if a**5 - b**5 == x:
        print(a, b)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

def factorization(n):
    arr = [1]
    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)

    if temp!=1:
        arr.append(temp)

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

    return arr
    
fact_ls = factorization(X)

flg = False
for f in fact_ls:
    for b in range(-999, 1000):
        a = b + f
        if (a ** 5 - b ** 5) == X:
            A = a
            B = b
            flg = True
            break
    if flg:
        break
else:
    A = 0
    B = 0

print(A, B)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    """Calculate prime factorization and return unique numbers and 1.
    """
    ans = set()
    ans_add = ans.add
    ans_add(1)
    while n % 2 == 0:
        ans_add(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            ans_add(f)
            n //= f
        else:
            f += 2
    if n != 1:
        ans_add(n)
    return ans


def main():
    x = int(input())
    # 素因数分解してユニークな因数を取る。
    insu = prime_factorize(x)
    # a^5 - b^5 も a - b も，ある因数の倍数となる。
    # ここは a >= b と仮定すると，a は正でなくては，xが負になっちゃう。

    b_min = -int(x ** (1 / 5))
    for n in insu:
        b = b_min
        while 1:
            a = b
            while 1:
                a += n
                if a < 0:
                    continue
                cand = a ** 5 - b ** 5
                if cand == x:
                    return f'{a} {b}'
                elif cand > x:
                    break
            b += 1
            if a ** 5 - b ** 5 > x:
                break


if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
# x>0,y<0のときは全探索で良い 10**(9/5)で十分
# x<0,y<0　もしくは x>0,y>0のときは考察 -- (*)
# x<0,y>0のときは条件からありえない．X>0を満たさない
# x5 - y4 = (x-y)(x4+x4y+x3y2+x2y2+xy3+y4)となる
# *の条件からx-y>0,右項>0が成立．なので右項に着目するとこれがXの約数のどれかになる
# それぞれの約数せいぜい10**4？こに対して，たかだか10**(9/4)くらいの計算をするので多分計算間に合う？
# う〜〜んなんか違う？

# Xの約数から(x-y)についてあり得る数を列挙していく
import math
X=int(input())

# まずx>0,y<0のとき，
max_a = int(pow(X,1/5))
for i in range(max_a+1):
    rest = X - pow(i,5)
    max_b=int(pow(rest,1/5))
    for b in range(max_b+1):
        if pow(b,5)==rest:
            print(i,' ',-b)
            exit()

# x>0,y>0もしくはx<0,y<0のとき
max_yakusu = int(math.sqrt(X))
yakusu=[]
for i in range(1,max_yakusu+1):
    if X%i==0:
        yakusu.append(i)
        yakusu.append(X/i)

# いま条件を満たすXが必ず存在するので，a**4...はyakusuのどれかに必ず等しい
for y in yakusu:
    moukatahou = X/y
    max_a = int(pow(y,1/4))
    # x>0,y>0のとき
    for a in range(max_a+1):
        b = a - moukatahou
        if b<0:
            continue
        ukou = pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4)
        if ukou==y:
            print(a,' ',b)
            exit()
    # x<0,y<0のとき
    for a in range(0,-max_a-1,-1):
        b = a - moukatahou
        if b>0:
            continue
        ukou = pow(a,4)+pow(a,3)*b+pow(a,2)*pow(b,2)+a*pow(b,3)+pow(b,4)
        if ukou==y:
            print(a,' ',b)
            exit()

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)+1000):
  if x%i == 0:
    tmp1 = 0
    tmp2 = 0
    a1 = i
    b1 = 0
    a2 = i-1
    b2 = -1
    while tmp1 <= x or 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 main():
    x = int(input())
    arr = factorization(x)
    if len(arr) == 1:
        factor = 1
    else:
        factor = arr[0][0]
    if x == 1:
        print(0, -1)
    else:
        for i in range(130):
            b = (i-1) ** 5
            a = (i-1 + factor) ** 5
            if a-b == x:
                print(i-1 + factor, i-1)
                break;

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
N1 = 0
N2 = 0

A = [0] * 80
for i in range(80):
    A[i] = (i-39)**5

for i in range(80):
    for j in range(80):
        if A[i] - A[j] == X:
            N1 = i-39
            N2 = j-39
            break

print(N1,N2)

Submission status: Wrong Answer

Solution code:
X=int(input())
flag=0
for i in range(10**9):
    A=i**5
    B=A-X
    if B<0:
        for j in range(10**9):
            b=j**5
            if B+b==0:
                ans=[i,j]
                flag=1
                break
            elif B+b>0:
                break
    else:
        for j in range(10**9):
            b=j**5
            if B-b==0:
                ans=[i,j]
                flag=1
                break
            elif B-b<0:
                break
    if flag==1:
        break
print(i,-j)

Submission status: Wrong Answer

Solution code:
X = int(input())

maxAplus = int(pow(X, 1.0/5.0))
maxAsub = int(pow(X, 1.0/4.0))

for a in range(1, maxAplus+1):
    for b in range(a):
        if pow(a, 5) + pow(b, 5) == X:
            print(a, -b)
            exit()
        elif pow(a, 5) + pow(b, 5) > X:
            break

for a in range(1, maxAsub+1):
    for b in range(a - 1):
        if pow(a, 5) - pow(b, 5) == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

a = 1
while a < math.pow(X, 1.0/5.0):
    a *= 10

b = a - 1
while a > 0:
    b = -a
    while b < a:
        if a**5 - b**5 == X:
            print(a, b)
            exit()
        b += 1
    a -= 1

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(30):
    if i ** 5 >= x and (i - 1) ** 5 < x:
        b = i ** 5 - x
        for j in range(30):
            if j ** 5 == b:
                print(i, j)
                exit()
    if i ** 5 <= x and (i + 1) ** 5 > x:
        b = i ** 5 - x
        for j in range(-30, 1):
            if j ** 5 == b:
                print(i, j)
                exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(-math.ceil(x**0.5), math.ceil(x**0.5), 1):
    b = int(i**5 - x)
    if b > 0:
        b = b**0.2
    else:
        b = -((-b)**0.2)
    try:
        if b % 1 == 0:
            print(i, int(b))
            break
    except:
        pass

Submission status: Wrong Answer

Solution code:
thisNum = int(input())

for index in range(int(pow(thisNum, 1/5)) + 1) :

	thisA = pow(index, 5)

	tempB = thisA - thisNum
	isNegative = True if tempB < 0 else False

	if isNegative :
		tempB = tempB * -1

	thisB = pow(tempB, 1/5).real
	
	thisBInt = int(thisB)
	if thisB == float(thisBInt) :

		if isNegative :
			thisB = thisB * -1
		print(str(int(thisA)) + ' ' + str(int(thisB)))
		break

Submission status: Wrong Answer

Solution code:
x = int(input())

import math
def trial_division(n):
    #素因数を格納するリスト
    num_list = []
    factor = set(num_list)
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.add(num)
    #リストが空ならそれは素数
    if not factor:
        return [1]
    else:
        factor.add(n)
        return factor


for number in trial_division(x):
  for a in range(round(x**(1/2))):
    b = a - number
    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())
i = 0
while i < 10000:
  A = i
  if (i**5-X) == -1:
    B = -1
    if A**5 - B**5 == X :
      break
  elif isinstance((i**5-X)**(1/5), float):
    B = int((i**5-X)**(1/5))

    if A**5 - B**5 == X :
      break
  A = -i
  if (i**5-X) == -1:
    B = -1
    if A**5 - B**5 == X :
      break
  elif isinstance((i**5-X)**(1/5), float):
    B = int((i**5-X)**(1/5))

    if A**5 - B**5 == X :
      break
  i = i+1


print(A, B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())

for A in range(10):
    for B in range(-1,10):
        ans=(A**5)-(B**5)
        if ans==x:
            print(A,B)
        break

Submission status: Wrong Answer

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

        B = int(pow(abs(B_),-5))
        if(B_<0):
            B *= -1
        if(B**5==B_):
            print(A,B)
            return
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
top = int(x**0.5)+1
A = 0
B = 0
flag = False

divs = []
for i in range(1, top):
    if x % i == 0:
        divs.append(i)

for d in divs:
    if flag:
        break
    for i in range(-100*d, 100*d+1):
        a = i
        b = a - divs[-1]
        if a**5 - b**5 == x:
            A = a
            B = b
            flag = True
            break

print(A, B)

Submission status: Wrong Answer

Solution code:
x = int(input())

root = int(x**(0.2))

flag = 0
for i in range(root - 10, root + 10):
    for j in range(-10, root):
        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())
a,b = 0,0
#check = 0
for i in range(100):
    #if check==1:
        #break
    for j in range(100):
        if i**5 - j**5 == x:
            a,b = i,j
            #check = 1
            break
        elif i**5 + j**5 == x:
            a,b = i,-j
            #check = 1
            break
        
print(a,b)

Submission status: Wrong Answer

Solution code:
x = int(input())

ichi = str(x)
ichi = int(ichi[-1])

for i in range(100):
  test = -(ichi - i)
  for j in range(10):
    for k in range(10):
#      print(test+j*10, i+k*10)
      if test+j*10**5 - i+k*10**5 == x:
        print(test+j*10, i+k*10)
        break
      elif (-1*test+j*10)**5 - (-1*i+k*10)**5 == x:
        print(-1*test+j*10, -1*i+k*10)
        break
    else:
      continue
    break
  else:
    continue
  break

Submission status: Wrong Answer

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

import sys
import math

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def enumerate_factor(x):
    i = 1
    factors = []
    while i * i <= x:
        if x % i == 0:
            factors.append(i)
            if x // i != i:
                factors.append(x // i)
        i += 1
    return factors

def main():
    x = read(int)
    
    boundary = math.ceil(math.pow(x, 1/5))
    for a in range(-boundary, boundary + 1):
        for b in range(-boundary, boundary + 1):
            if a**5 - b**5 == x:
                print(f"{a} {b}")
                return

if __name__ == "__main__":
    main()

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(i)
    i += 1
  if n > 1:
    table.append(int(n))
  return table
def main():
  sFlag=False
  X= int(input())
  X_table=prime_decomposition(X)
  X_table.append(1)
  for i in range(int(X**(1/5))):
    A=i
    for j in range(len(X_table)):
      B=A-X_table[j]
      X_n=A**5-B**5
      if(X_n==X):
        print(A,B)
        sFlag=True
        break
    if(sFlag==True):
      break

if __name__=='__main__':
  main()

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=-2,10**10+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
    
    l,r=-10**10,10
    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())

#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(0, 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())
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(-100000,100000):
  b = -k
  a = a_b + b
  if a**5 - b**5 == X:
    print(a,b)
    exit()
for k in range(-100000,100000):
  b = -k
  a = tmp + b
  if a**5 - b**5 == X:
    print(a,b)
    exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

# for b in range(65, -64, -1):

for a in range(10000, -10000, -1):
    b = -(X - a**5)**0.2
    # print('b a', b, a)
    if type(b) == complex:
        if b.imag != 0:
            continue
        print(a, int(b.real))
        exit()
    elif b.is_integer():
        print(a, int(b))
        exit()

for b in range(10000, -10000, -1):
    a = (X + b**5)**0.2
    # print('b a', b, a)
    if type(a) == complex:
        if a.imag != 0:
            continue
        print(int(a.real), b)
        exit()
    elif a.is_integer():
        print(int(a), b)
        exit()

Submission status: Wrong Answer

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

        B = int(pow(abs(B_),-5))
        if(B_<0):
            B *= -1
        if(B**5==B_):
            print(A,B)
            return
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    pf = {}
    m = X
    for i in range(2, int(m**0.5)+1):
        while m % i == 0:
            pf[i] = pf.get(i, 0)+1
            m //= i
    if m > 1:
        pf[m] = 1

    for i in range(0, len(pf)):
        p = pf.get(i)
        for a in range(1, 60, 1):
            for b in range(-60, 0, 1):
                if X == pow(a, 5) - pow(b, 5):
                    print(str(a) + " " + str(b))
                    exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

import math
def trial_division(n):
    #素因数を格納するリスト
    num_list = []
    factor = set(num_list)
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.add(num)
    #リストが空ならそれは素数
    if not factor:
        return [1]
    else:
        factor.add(n)
        return factor


for number in trial_division(x):
  for a in range(round(x**(1/3))):
    b = a - number
    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:
import math
X = int(input())

num = 0
flag = math.pow(abs(num**5-X), 1.0/5.0)
while flag != int(flag):
  #print(num)
  #print(flag)
  #input()
  num += 1
  flag = math.pow(abs(num**5-X), 1.0/5.0)
flag = int(flag)
if X == num**5 - flag**5:
  print(num, flag)
elif X == (-num)**5 - flag**5:
  print(-num, flag)
elif X == (-num)**5 -(-flag)**5:
  print(-num, -flag)
elif X == (num)**5 - (-flag)**5:
  print(num, -flag)
elif X == (flag)**5 - num**5:
  print(flag, num)
elif X == (-flag)**5 - num**5:
  print(-flag, num)
elif X == (-flag)**5 - (-num)**5:
  print(-flag, -num)
elif X == (flag)**5 - (-num)**5:
  print(flag, -num)

Submission status: Wrong Answer

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

    for a in range(1, 101):
        b = 0
        mi = False
        if a ** 5 - x < 0:
            b = ((a ** 5 - x)*(-1)) ** 0.2
            mi = True

        else:
            b = (a ** 5 - x) ** 0.2

        if b.is_integer():
            b = int(b) * (-1) if mi else int(b)
            print(a, b)
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(-100, 100):
    flag = False
    for j in range(-100, 100):
        tmp = i ** 5 - j ** 5
        if tmp == x:
            print('{} {}'.format(i, j))
            flag = True
            break
    if flag:
        break

Submission status: Wrong Answer

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

for a in range(64):
  if (x-a**5)%1==0:
    for b in range(64):
      bb = b**5
      if a**5-x==bb:
        print('%d %d'%(a,b))
        exit(0)
      bb = (-b)**5
      if a**5-x==bb:
        print('%d %d'%(a,-b))
        exit(0)

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
y = []
for i in range(100):
    y.append(i**5)
for j in range(100):
    for k in range(j,100):
        if y[k]+ y[j] == x:
            a = k
            b = j 
            print(a, -b)
            break 
        if y[k] - y [j] == x:
            a = k
            b = j
            print(a,b)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())
y = []
count1 = 0
flag = 0
for i in range(0, 70):
  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))
      break;
    if y3 == x:
      print(str(count1) + " " + str(count2))
      break;
    count2 +=1
  count1 += 1

Submission status: Wrong Answer

Solution code:
def find_x(x):
    while True:
        size = len(pow5)
        for a in range(size):
            for b in range(size):
                pp = pow5[a] - pow5[b]
                if pp == x:
                    return a, b
                pm = pow5[a] + pow5[b]
                if pm == x:
                    return a, -b
                mp = - pow5[a] - pow5[b]
                if mp == x:
                    return -a, b
                mm = - pow5[a] + pow5[b]
                if mm == x:
                    return -a, -b
        pow5.append((size + 1) ** 5)


pow5 = [0, 1, 32]
X = int(input())
A, B = find_x(X)
print(A, B)

Submission status: Wrong Answer

Solution code:
def DI(n):
    D = []
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            D.append(i)
            if i != n//i:
                D.append(n//i)
    return D
X = int(input())
D = DI(X)
flag = False
for i in range(len(D)):
    for a in range(D[i]+1):
        b = D[i] - a
        if a**5 + b**5 == X:
            print(str(a) + ' ' + str(b))
            flag = True
            break
    if flag:
        break

Submission status: Wrong Answer

Solution code:
a=[i for i in range(-70,71)]
x=int(input())
for i in range(len(a)):
    c=1
    for j in range(len(a)):
        # print(pow(a[i],5)-pow(a[j],5))
        t=pow(a[i],5)-pow(a[j],5)
        if (t==x):
            print(a[i],a[j])
            c=0
            break
        elif(t==-x):
            print(a[j],a[i])
            c=0
            break
    if(c==0):
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

lim = 10000000000
d = dict()
i = 0
cand = 0
while(cand <= lim):
    cand = i ** 5
    d[cand] = i
    i += 1

for k, v in d.items():
    if (x-k) in d:
        print(d[x-k], -v)
        break
    elif (x+k) in d:
        print(d[x+k], v)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())
i = 0
while i < 10000:
  A = i
  if (i**5-X) == -1:
    B = -1
    if A**5 - B**5 == X :
      break
  elif isinstance((i**5-X)**(1/5), float):
    B = int(abs((i**5-X)**(1/5)))

    if A**5 - B**5 == X :
      break
  A = -i
  if (i**5-X) == -1:
    B = -1
    if A**5 - B**5 == X :
      break
  elif isinstance((i**5-X)**(1/5), float):
    B = int(abs((i**5-X)**(1/5)))

    if A**5 - B**5 == X :
      break
  i = i+1


print(A, B)