Problem:


Score : 400 points

Problem Statement

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

Constraints

1 \leq X \leq 10^9

X is an integer.

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

Input

Input is given from Standard Input in the following format:

X

Output

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

A B

Sample Input 1

33

Sample Output 1

2 -1

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

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(2000)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
import sys, math
import bisect, heapq
import collections

sys.setrecursionlimit(10 ** 6)

input = sys.stdin.readline

gets = lambda: input().rstrip()
getn = lambda: int(input())
getmul = lambda: (int(i) for i in input().split())
getlist = lambda: [int(i) for i in input().split()]

x = getn()


for b in range(0, 10 ** 9 + 1):
    print(b)
    b5 = b ** 5
    a5 = x + b5
    a = a5 ** (1 / 5)
    if a5 == a ** 5:
        print(int(a), b)
        exit()
    a5 = x - b5
    a = a5 ** (1 / 5)
    if a5 == a ** 5:
        print(int(a), -b)
        exit()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())

for a in range(-100, 100):
    for b in range(-100, 100):
        if a ** 5 - b ** 5 == X:
            print(a, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
def main():
    from builtins import int, map, list, print, len
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    X = input_number()
    t = []
    i = 0
    while True:
        x = i ** 5
        t.append(x)
        if x > 10 ** 9:
            break
        i += 1
    for i in range(len(t)):
        for j in range(i, len(t)):
            a = t[i]
            b = t[j]
            if a - b == X:
                print(i, j)
                exit()
            elif a + b == X:
                print(i, -j)
                exit()



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
lis = []
for i in range(-35,36):
    lis.append(i**5)
tab = [[0]*71 for _ in range(71)]
for j in range(71):
    for k in range(71):
        tab[j][k] = lis[j]-lis[k]
for l in range(71):
    for m in range(71):
        if tab[l][m] == x:
            print(l-35, m-35)
            exit()

Submission status: Wrong Answer

Solution code:
import math
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
  
lis = sorted(make_divisors(X))
min_lis = [[10**10, 0, 0]]
for i in range(X):
  A = i
  if X-A**5 < 0:
    break
  B = -(X-A**5)**(1/5)
  if A**5-round(B)**5 == X:
    min_lis.append([A, round(B)])
print(min_lis[-1][0], min_lis[-1][1])

Submission status: Wrong Answer

Solution code:
from math import log, exp, floor
s = int(input())
b = -1

while True:
    a = s + (b ** 5)
    try:
        temp_a = exp(log(a)/5)
        if temp_a == floor(temp_a):
            print("{} {}".format(floor(temp_a), b))
            break
        b += 1
    except:
        b += 1

Submission status: Wrong Answer

Solution code:
x=int(input())
A=0
B=0
for i in range(100):
  for j in range(i+1):
    a=pow(i,5)
    b=pow(j,5)
    if a-b==x:
      A=i
      B=j
for i in range(80):
  for j in range(80):
    a=pow(i,5)
    b=pow(j,5)
    if a+b==x:
      A=i
      B=-j
print(A,B)

Submission status: Wrong Answer

Solution code:
X = int(input())

div = []

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

div = sorted(set(div))

for d in div:
    A = 0
    while True:
        B = A - d
        R = A**4 + A**3 * B + A**2 * B**2 + A* B**3 + B**4
        Y = (A-B) * R
        if Y == X:
            print(A,B)
            exit()

        B = d + A
        R = A**4 + A**3 * B + A**2 * B**2 + A* B**3 + B**4
        Y = (A-B) * R
        if Y == X:
            print(A,B)
            exit()
        if abs(Y) > 10**9:
            break
        A += 1

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

inX = math.ceil(X**(1/5))
for i in range(-100, 100):
    for j in range(-100, 100):
        if i**5 - j**5 == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math

import itertools
import heapq
#import bisect

import copy
from functools import lru_cache

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)


def main():
    x=int(input())
    ans=[0,0]
    for i in range(-101,101):
        for j in range(-101,101):
            if j**5-i**5==x:
                ans=[j,i]
                break
    print(*ans)






if __name__ == "__main__":

    main()

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
while (abs((a**5-x)**(1/5))).is_integer()==False:
  a+=1
if a**5-x>=0:
  print(a,int((a**5-x)**(1/5)))
else:
  print(a,int(-((x-a**5)**(1/5))))

Submission status: Wrong Answer

Solution code:
X = int(input())

flag = False
for i in range(-10 ** 2, 10 ** 2):
  for j in range(-10 ** 2, 10 ** 2):
    if pow(i, 5) - pow(j, 5) == X:
      print(i, j)
      flag = True
      break
  if flag:
    break

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(1000)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
import sys

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


def solve():
    X = int(rl())
    
    five_pow = [0]
    i = 1
    while five_pow[-1] < 10 ** 10:
        five_pow.append(i ** 5)
        i += 1
    
    for a in range(len(five_pow)):
        pow_of_a = five_pow[a]
        
        b = pow(abs(pow_of_a - X), 1./5.)
        if b.is_integer():
            print(a, int(b))
            exit()


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

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

Submission status: Wrong Answer

Solution code:
A= int(input())
nu = set()
for i in range(0,64):
    nu.add(i**5)
for j in range(1,64):
    B = abs(j**5-A)
    if B in nu:
        print(j,int(-1*pow(B,1/5)))
        exit()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main(X=None):
    if X is None:
        X = ii()
    for a in range(-70, 70):
        b5 = a**5 - X
        b = meg(lambda v: v**5<=b5, -100, 100)
        if a**5 - X == b**5:
            print(a, b)
            return

main()

Submission status: Wrong Answer

Solution code:
x = int(input())

for i in range(-5000, 5000):
    b = i
    a = int(x+b**5)
    if a**5-b**5 == x:
        break

print(a, b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 0
    mcount =0

    for i in range(0,100000):
        c = i **5
        ansdict[i]=c
        ansdict[i*-1]=c*-1
        if c>2*a:
            count = i
            mcount = -1*i
            break
    flag = 0

    for i in range(mcount,count):
        for j in range(mcount,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break

Submission status: Wrong Answer

Solution code:
x=int(input())


targetList=[]
for i in range(-100,100):
    targetList.append(i**5)

for i in range(-100,100):
    for j in range(i,100):
        if targetList[100+j]-targetList[100+i]==x:
            print(str(j)+" "+str(i))
            exit()

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import Counter
import itertools
import fractions
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################
 

X=II()

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

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(201)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()

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_yaku = make_divisors(X)

for A in range(int(X**0.2)+1):
	for x in x_yaku:
		B = A-x
		if (A-B)*(A**4+A**3*B+A**2*B**2+A*B**3+B**4) == X:
			print(A, B)
			exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
def I(): 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 S(): return sys.stdin.readline().rstrip()
def LS(): return sys.stdin.readline().split()
def LS2(N): return [sys.stdin.readline().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**5+10)
#input = sys.stdin.readline
X = I()
five_l = [-1]*200
f=0
for a in range(200):
    five_l[a]=pow(a,5)
    now = five_l[a]
    for i in range(a+1):
        search = five_l[i]
        if search+now==X:
            print(a,-i)
            f = 1
            break
        elif search-now == X:
            print(a,i)
            f = 1
            break
    if f==1:
        break

Submission status: Wrong Answer

Solution code:
import sys

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())
dn = factorization(X) 

for i in dn:
  N = i[0]

  for j in range(-N, N+1, 1):
    A = N + j
    B = j

    if A**5-B**5==X:
      print("{0} {1}".format(A, B))
      sys.exit(0)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
x = int(input())
for a in range(-65, 66):
    for b in range(-65, 66):
        if a**5 - b**5 == x:
            print(a, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(201)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)
print(200**5)

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    for a in range(int(X**0.2)+1):
        for b in range(int(X**0.2)+1):
            if a**5 + b**5 == X:
                print(a, b*(-1))
                return
    for b in range(int(X**0.25)+1):
        temp = (X + b**5)**0.2
        if temp == int(temp):
            print(int(temp), b)
            break
main()

Submission status: Wrong Answer

Solution code:
def main():
    tmp = [-10000000000, -9509900499, -9039207968, -8587340257, -8153726976, -7737809375, -7339040224, -6956883693, -6590815232, -6240321451, -5904900000, -5584059449, -5277319168, -4984209207, -4704270176, -4437053125, -4182119424, -3939040643, -3707398432, -3486784401, -3276800000, -3077056399, -2887174368, -2706784157, -2535525376, -2373046875, -2219006624, -2073071593, -1934917632, -1804229351, -1680700000, -1564031349, -1453933568, -1350125107, -1252332576, -1160290625, -1073741824, -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, 1073741824, 1160290625, 1252332576, 1350125107, 1453933568, 1564031349, 1680700000, 1804229351, 1934917632, 2073071593, 2219006624, 2373046875, 2535525376, 2706784157, 2887174368, 3077056399, 3276800000, 3486784401, 3707398432, 3939040643, 4182119424, 4437053125, 4704270176, 4984209207, 5277319168, 5584059449, 5904900000, 6240321451, 6590815232, 6956883693, 7339040224, 7737809375, 8153726976, 8587340257, 9039207968, 9509900499, 10000000000]
    x = int(input())
    for i in range(100,201):
        for j in range(201):
            if tmp[i] - tmp[j] == x:
                print(i-100,j-100)
                exit()

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy


if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 0
    mcount =0

    for i in range(0,1000):
        c = i **5
        ansdict[i]=c
        ansdict[i*-1]=c*-1
        if c>2*a:
            count = i
            mcount = -1*i
            break
    flag = 0

    for i in range(mcount,count):
        for j in range(mcount,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break

Submission status: Wrong Answer

Solution code:
X=int(input())
for i in range(0,1001):
  for j in range(i+1,1002):
    j5=j**5
    i5=i**5
    if j5-i5==X:
      print(i,j)
      exit()
    if j5+i5==X:
      print((-1)*i,j)
      exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
import math
for a in range(70):
    if a**5 >= x :
        B=a**5-x
        b = math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            b=int(b)
            print(a,b)
            break
    else:
        B=x-a**5
        b=math.pow(B, 1.0/5.0)
        #print(b)
        if b.is_integer()==True:
            b=int(b)
            print(a,-b)
            break

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    A = 1
    B = 0
    while A <= 100:
        for B in range(A-1, A*(-1)-1, -1):    
            x = A ** 5 - B ** 5
            # print(A, B, x)
            if x == X:
                print(A, B, sep=" ")
                return
        # break
        A += 1

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
l = []
for i in range(-1000,1001):
    l.append(i**5)
for i in range(len(l)-1):
    for j in range(i,len(l)):
        if abs(l[i]-l[j]) == X:
            ai = i-1000
            aj = j-1000
            break
print(ai,aj)

Submission status: Wrong Answer

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
x=int(input())
A=[int(i) for i in range(101)]
Ans=[]
for a in A:
  for b in A:
    if a+b**5==x and not Ans:
      Ans=[a,-b]
    if a**5-b**5==x and not Ans:
      Ans=[a,b]
print(*Ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    ansdict= {}
    count = 0
    mcount =0

    for i in range(0,100):
        c = i **5
        ansdict[i]=c
        ansdict[i*-1]=c*-1
        if c>2*a:
            count = i
            mcount = -1*i
            break
    flag = 0

    for i in range(mcount,count):
        for j in range(mcount,count):
            ans = ansdict[j]-ansdict[i]
            if ans ==a:
                print(str(j) + " " +str(i))
                flag+=1
                break
        if flag == 1:
            break

Submission status: Wrong Answer

Solution code:
def main():
    from builtins import int, map, list, print, len
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    X = input_number()
    t = []
    i = 0
    while True:
        x = i ** 5
        t.append(x)
        if x > 10 ** 9:
            break
        i += 1
    for i in range(len(t)):
        for j in range(i, len(t)):
            a = t[i]
            b = t[j]
            if a - b == X:
                print(i,j)
            elif a + b == X:
                print(i,-j)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x= int(input())
i =0
while True:
    for j in range(i,-555,-1):
        if i**5==j**5+x:
            print(str(i)+" "+str(j))
            break
    break

Submission status: Wrong Answer

Solution code:
from math import log, exp, floor
s = int(input())
b = -1

while True:
    a = s + (b ** 5)
    if a != 0:
        temp_a = exp(log(a)/5)
        if temp_a == floor(temp_a):
            print("{} {}".format(floor(temp_a), b))
            break
    else:
        print('{} {}'.format(a, b))
        break
    b += 1

Submission status: Wrong Answer

Solution code:
import math

import itertools

x = int(input())
all_a = [a ** 5 for a in range(-70, 70)]

for comb in itertools.combinations(all_a + all_a, 2):
    if comb[0] - comb[1] == x:
        a = int(math.pow(abs(comb[0]), 1 / 5))
        b = int(math.pow(abs(comb[1]), 1 / 5))

        if comb[0] < 0:
            a *= -1
        if comb[1] < 0:
            b *= -1

        print(a, b)
        exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys

X = int(input())
for i in range(-100,101):
    for k in range(-100,101):
        if i-k!=0 and (X/(i-k)).is_integer():
            if i**5-k**5==X:
                print(i,k)
                sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
x = int(input())
for a in range(65):
    for b in range(-64, a):
        if a**5 - b**5 == x:
            print(a, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())

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

Submission status: Wrong Answer

Solution code:
def main():
    D = int(input())
    flag = False
    for a in range(-64, 64):
        for b in range(-64, 64):
            if a ** 5 - b ** 5 == D:
                print(a, b)
                return
        
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

A = [a ** 5 for a in range(100)]
for b in range(100):
    B = b ** 5
    if X + B in A:
        print(A.index(X + B), b)
        break
    if X - B in A:
        print(A.index(X - B), -b)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(2000):
  for j in range(-100,1000):
    if i**5 - j**5 == x and x%(i-j) == 0:
      print(i,j)
      break

Submission status: Wrong Answer

Solution code:
x=int(input())
f=False
for a in range(-100,100):
    for b in range(-100,100):
        v=a**5-b**5
        if v==x:
            f=True
            break
    if f:
        break
print(str(a) + " " + str(b))

Submission status: Wrong Answer

Solution code:
from math import sqrt, log, pow
num = [i**5 for i in range(-1, 300)]
X = int(input())
c = 0
for i in range(len(num)):
    a = num[i]
    for j in range(i+1):
        if a - num[j] == X:
            print(i-1, j-1)
            exit()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())

MAX = pow(10,3)

for b in range(-MAX,MAX):
  temp = X+pow(b,5) #これがaの5乗
  if temp <= 0:
    continue
  a = pow(temp,1/5)
  if a.is_integer():
    print(int(a),int(b))
    sys.exit()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import sys
import math

X = int(input())

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

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


for a in range(100):
    r = X - a ** 5
    b5 = 0
    for b in range(65):
        b5 = b ** 5
        if b5 == r:
            #print("%d %d" % (-a, b))
            print("%d %d" % (b, -a))
            sys.exit()
        if b5 > r:
            break

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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 operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

x=ii()

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

Submission status: Wrong Answer

Solution code:
import sys
K = int(input())
num = [i**5 for i in range(110)]
for i in range(len(num)):
    for j in range(len(num)):
        if num[i] - num[j] == K :
            print(i,j)
            sys.exit()
        elif num[i] + num[j] == K:
            print(i,-j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

m = 100
for a in range(-m, m + 1):
    for b in range(-m, m + 1):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit(0)

Submission status: Wrong Answer

Solution code:
x=int(input())
i=1
ans=0
if x==1:
    i=0
else:
    while ans<x:
        ans=(i**5)-(-1)
        i=i+1
    i=i-1
       
print(i,-1)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
x=int(input())
if x==0:
    print('0 0')
i=0
while True:
    flag=False
    a=pow(i,5)
    r=x-a
    if r<0:
        r*=-1
        flag=True
    j=1
    n=1
    while n<r:
        j+=1
        n=pow(j,5)
    print(i,j,a,r)
    if n==r and not flag:
        print(i,-1*j)
        break
    elif n==r and flag:
        print(i,j)
        break
    else:
        i+=1