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:
m=6**6
exec(f'i,j=m%120,m//120;m-=i**5-j**5!={input()}or exit(print(i,j));'*m)

Submission status: Wrong Answer

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

b = -1
while True:
    b+=1
    amin = (x + b**5)**0.2
    apls = (x - b**5)**0.2

    if isinstance(amin, float):
        amin = round(amin,10)
        if amin.is_integer():
            print(int(amin),b)
            break
    elif isinstance(apls,float):
        apls = round(apls,10)
        if apls.is_integer():
            print(int(apls),-1*b)
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

a = -1
while True:
    a+=1
    bmin = round((x + a**5)**0.2, 1)
    bpls = round((x - a**5)**0.2,1)

    if isinstance(bmin, float) and bmin.is_integer():
        print(a,int(bmin))
        break
    elif isinstance(bpls,float) and bpls.is_integer():
        print(a,int(bpls))
        break

Submission status: Wrong Answer

Solution code:
# D - I hate Factorization
def meet_condition(i, j):
	pi = pows[i]
	pj = pows[j]
	
	if pi - pj == x:
		return i, j
	elif pi + pj == x:
		return i, -j


pows = []

for i in range(100):
	pows.append(pow(i, 5))

x = int(input())

for i in range(len(pows)):
	for j in range(len(pows)):
		if meet_condition(i, j) != None:
			a, b = meet_condition(i, j)
			print(a, b)
			exit()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().strip()

def main():
    X = int(input())
    for diff in range(-200,200):
        for a in range(-200,200):
            b = a-diff
            if (a**5 - b**5) == X:
                break
    print(a,b)

# 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])
#             arr.append(i**cnt)
#
#     if temp!=1:
#         # arr.append([temp, 1])
#         arr.append(temp)
#
#     if arr==[]:
#         # arr.append([n, 1])
#         arr.append(n)
#     return arr
#
# def main():
#     N = int(input())
#     n_fac = factorization(N)
#     mi = min(n_fac)
#     ma = max(n_fac)
#     # print(n_fac)
#     # print(mi)
#     y = -5
#     x = None
#     while True:
#         if mi**4 -3*mi**3*y + 10*mi**2*y**2 + 2*mi*y**3 + 5*y**4 == ma:
#             x = y + mi
#             break
#         else:
#             y += 1
#     print(x,y)
main()

Submission status: Wrong Answer

Solution code:
x = int(input())

flag = False
for a in range(-118, 119):
    if(flag):
        break
    for b in range(-118, 119):
        if(flag):
            break
        if pow(a, 5) - pow(b, 5) == x and x > 0:
            print(a,b)
            flag = True
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

flag = False
for a in range(-118, 119):
    if(flag):
        break
    for b in range(-118, 119):
        if(flag):
            break
        if pow(a, 5) - pow(b, 5) == x:
            print(a,b)
            flag = True
            break

Submission status: Wrong Answer

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
X = int(input())
for A in range(-100,101):
    for B in range(-100,101):
        if A**5 - B**5 == X:
            print(A,B)
            exit()
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Wrong Answer

Solution code:
def power(x,y):
	res=1
	while y>0:
		if y%2==1:
			res=(res*x)
		y=y//2
		x=x*x
	return res

x=int(input())
for i in range(-100,101,1):
	rr=power(i,5)
	for j in range(-100,101,1):
		temp=rr-power(j,5)
		if temp==x:
			print(i,j)
			exit()

Submission status: Wrong Answer

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

for b in range(-1000,1001):
    a = b**5 + x
    if a >= 0:
        print(a,b)
        sys.exit()

Submission status: Wrong Answer

Solution code:
c=20000
exec(c*2*f'i=c%200;j=c//200;i**5-j**5-{input()}or exit(print(i,j));c-=1;')

Submission status: Wrong Answer

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


def sqrt5(n):
    negative = True if n < 0 else False
    for i in range(1000):
        if i ** 5 == abs(n):
            if negative:
                return -i
            return i


def solve(X: int):
    pos = {x ** 5 for x in range(100) if x ** 5 <= int(1e15)}
    neg = {-x for x in pos}
    nums = pos.union(neg)
    for a in nums:
        # b = a - x
        if a - X in nums:
            b = a - X
            print(sqrt5(a), sqrt5(b))
            return
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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


def sqrt5(n):
    negative = True if n < 0 else False
    for i in range(1000):
        if i ** 5 == abs(n):
            if negative:
                return -i
            return i


def solve(X: int):
    pos = {x ** 5 for x in range(100) if x ** 5 <= int(1e12)}
    neg = {-x for x in pos}
    nums = pos.union(neg)
    for a in nums:
        # b = a - x
        if a - X in nums:
            b = a - X
            print(sqrt5(a), sqrt5(b))
            return
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    solve(X)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())
dvs = []
for i in range(1,X+1):
    if X%i == 0:
        dvs.append(i)

m = 0
for i in range(len(dvs)):
    B = -1
    A = B + dvs[i]
    fx = A **5-B**5
    while fx <= X:
        if fx == X:
            s = f'{A}  {B}'
            print(s)
            m = 1
            break
        if B < 0:
            B = B + 2 *(-1 - B) +1
        else:
            B = B - 2*(B + 1) 
        A = B + dvs[i]
        fx = A **5-B**5
        if fx > X:
            break
       
        
    if m ==1:
        break

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())
    ok = False
    for b in range(-64, 65):
        for a in range(b + 1, 65):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                ok = True
                break
        if ok:
            break


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#encoding utf-8
import math

def isAnswer(a, b, X):
    return int(math.pow(a, 5) - math.pow(b, 5)) == X

def pow5(x):
    if x < 0:
        return -1 * math.pow(abs(x), 5)
    return math.pow(x, 5)

def resolver(X):
    for b in range(-300, 300):
        a5 = X + pow5(b)
        if a5 < 0:
            continue
        a = int(math.pow(a5, 0.2))
        print(a5, a)
        if isAnswer(a, b, X):
            return a, b 
    return 0, 0

def main():
    X = int(input())
    a,b = resolver(X)
    print(a, b)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X=int(input())
flg=False
for A in range(-118,119):
    for B in range(-118,119):
        if A**5-B**5==X:
            print(str(A)+" "+str(B))
            flg=True
            break
    if flg:
        break

Submission status: Wrong Answer

Solution code:
def main():
    X = int(input())
    A = 0
    B = 0
    while True:
        A += 1
        if A**5 - B**5 > X:
            break
        if A**5 - B**5 == X:
            print(A,B)
            return
    A -= 1
    while True:
        B -= 1
        if A**5 - B**5 > X:
            break
        if A**5 - B**5 == X:
            print(A,B)
            return
    A += 1
    B = 0
    while True:
        B += 1
        if A**5 - B**5 < X:
            break
        if A**5 - B**5 == X:
            print(A,B)
            return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-118, 120):
    for b in range(-118, 120):
        if (a ^ 5 - b ^ 5) == X:
            print(a, b)
            break
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

M = 21148

ns = [i**5 for i in range(M)]
n5s = {i**5:i for i in range(M)}

result = None
for i in range(M):
    b = ns[i]
    if b + X in n5s:
        result = i, n5s[b + X]
    if X - b in n5s:
        result = i, -n5s[X - b]

print(*result)

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())
# aは正の数とする
# bが負の場合
max_a = math.floor(x ** (1/5))
print(max_a)
for i in range(max_a,-1,-1):
    b5 = x - (i ** 5)
    b = round(b5 ** (1/5), 5)
    if b.is_integer():
        print(i,int(-1 * b))
        sys.exit()
# bが正の場合
for i in range(120):
    for j in range(i + 1, 120):
        if j**5 - i**5 == x:
            print(j, i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-118, 119):
    for b in range(-118, 119):
        if x == a ** 5 - b ** 5:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
flg = False
for A in range(119):
    Ap = A**5
    for B in range(119):
        Bp = B**5
        if Ap-Bp==X:
            print(A,B)
            flg = True
            break
        elif Ap+Bp==X:
            print(A,-B)
            flg = True
            break
    if flg:
        break

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())
# aは正の数とする
# bが負の場合
max_a = math.floor(x ** (1/5))
for i in range(max_a,-1,-1):
    b5 = x - (i ** 5)
    b = b5 ** (1/5)
    if b.is_integer():
        print(i,int(-1 * b))
        sys.exit()
# bが正の場合
d = math.ceil(x ** (1/5))
for i in range(120):
    for j in range(i + 1, 120):
        if j**5 - i**5 == x:
            print(j, i)
            sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())

p5 = [x**5 for x in range(-70, 70)]

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

Submission status: Wrong Answer

Solution code:
X = int(input())

A = 0
B = 0

tmp = 0
if X == 0:
  i=0
elif X == 1:
  i=0
else:
  i = 1
  while pow(i,5) < X:
    A = pow(i,5)
    i += 1
  i = i -1

tmp = X - A

if tmp == 0:
  j = 0
elif tmp == 1:
  j = -1
else:
  j = 1
  while pow(j,5) == tmp:
    B = pow(j,5)
    j = j + 1
  j = j - 1

  
print(i,j)

Submission status: Wrong Answer

Solution code:
import numpy as np

x = int(input())
a = 0

def fsq(x_):
    global a
    a = x_ ** (0.2)
    if a == int(a):
        a = int(a)
        return True
    else:
        return False
    
for b in range(100):
    if fsq(x-b):
        print(a, -b)
        break
    elif fsq(x+b):
        print(a, +b)
        break

Submission status: Wrong Answer

Solution code:
import sys
x = int(input())
d = []
for i in range(1, int(x**(1/2)) + 1):
    if x % i == 0:
        d.append(i)
        if x//i not in d:
            d.append(x//i)
for n in d:
    for a in range(-10, 10):
        b = a - n
        secondterm = (a**4) + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if x//n == secondterm:
            print(a, b)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    x=int(input())
    for i in range(-200,200):
        for j in range(-200,200):
            if i**5-j**5==x:
                print(i,j)
                break
resolve()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(-1000, 1000):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()
        b = a + elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == - n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(-500, 500):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()
        b = a + elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == - n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x=int(input())

for a in range(-118,119):
  for b in range(-119,118):
    if a**5-b**5==x:
      break
    else:
      continue
  break
  
print(a,b)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(-300, 300):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()
        b = a + elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == - n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(-300, 300):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()
        else:
            b = a + elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(-300, 300):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


n = int(input())
A = [1] + prime_factorize(n) + [n]
# print(A)
k = len(A)

a = 0
b = 0
for elem in A:
    for a in range(0, 300):
        b = a - elem
        if a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4 == n / elem:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

ans = 0
for i in range(-100,100):
    for j in range(-100,100):
        ans = i**5 -j**5
        if ans == x:
            print(i,j)
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
#a^5 - b-5 = (a-b)(a^4 + a^3 b + a^2 b^2 + a b^3 + b^4)

def prime_num(n):
  a = []
  while n%2 == 0:
    a.append(2)
    n = n//2
  b = 3
  while b**2 <= n:
    if n%b == 0:
      a.append(b)
      n = n//b
    else:
      b += 2
  if n != 1:
    a.append(n)
  return a

x = int(input())
if x == 1:
  prime = [1]
else:
  prime = prime_num(x)
print(prime)

for p in prime:
  for a in range(x+1):
    b = a - p
    if a**5 - b**5 == x:
      print(a, b)
      exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(126):
    for b in range(-126, 126):
        if x == 0: continue
        if x == a ** 5 - b ** 5:
            print(a, b)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
for i in range(1,70):
    a=i**5
    for j in range(-70,70):
        if a-j**5==x:
            print(i,j)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input()) 

for a in range(127):
    for b in range(-64, 64):
        if x == a ** 5 - b ** 5:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
x = int(input()) 

for a in range(126):
    for b in range(-63, 63):
        if x == a ** 5 - b ** 5:
            print(a, b)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(-118, 120):
  for b in range(-118, 120):
    if a**5 - b**5 == x:
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(-118, 120):
    for b in range(-119, 119):
        if a**2 - b**2 == X:
            print(a, b)
            exit()

Submission status: Wrong Answer

Solution code:
# D
import math
X = int(input())

B = -math.floor(math.pow(X, 0.2))
for b in range(B, 100000):
    tmp = math.pow(X + b ** 5, 0.2)
    if int(tmp) - tmp == 0:
        break
        
tmp = int(tmp)
print(tmp, b)

Submission status: Wrong Answer

Solution code:
def a5b5(X):
    for i in range(0,6):
        for j in range(-1000, 1000):
            if (i**5 - j**5 == X):
                print(i, j)
                return        


X = int(input())
A = 0
B = 0
a = a5b5(X)

Submission status: Wrong Answer

Solution code:
X = int(input())
for bi in range(-200,200):
    a = pow((pow(bi,5) + X ),(1/5))
    if (type(a) == float and a.is_integer) or (type(a) == int):
        print(int(a),int(bi))
        break
    else:
        continue

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# べき乗は、a ** n or pow(a, n)
X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、130 , 129

for bi in range(-200,200):
    a = pow((pow(bi,5) + X ),(1/5))
    if (type(a) == float and a.is_integer) or (type(a) == int):
        if X%(a - bi) == 0:
            print(int(a),int(bi))
            break
    else:
        continue

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# べき乗は、a ** n or pow(a, n)
X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、130 , 129

for bi in range(-129,129):
    a = pow((pow(bi,5) + X ),(1/5))
    if (type(a) == float and a.is_integer) or (type(a) == int):
        if X%(a - bi) == 0:
            print(int(a),int(bi))
            break
    else:
        continue

Submission status: Wrong Answer

Solution code:
def f(x):
    return int((5*(x**4) + 10*(x**3) + 10*(x**2) + 5*x + 1)*(1/5))
X = int(input())

for A in range(max([f(X),10])):
    C = A**5 - X
    B = abs(C**(1/5))
    if C < 0:
        B *= -1
    if B.is_integer():
        print(A, end=" ")
        print(int(B))
        exit()

Submission status: Wrong Answer

Solution code:
i=0
exec('j=-i;exec("i**5-%s-j**5or exit(print(i,j));j+=1;"*999);i+=1;'%input()*99)

Submission status: Wrong Answer

Solution code:
i=0
exec('j=-i;exec("i**5-%s-j**5or exit(print(i,j));j+=1;"*200);i+=1;'%input()*99)

Submission status: Wrong Answer

Solution code:
N=int(input())
K=100
M=2*K+1
ls=[i-K for i in range(M)]
pow5=[n**5 for n in ls]
f=0
for i in range(M):
  for j in range(i,M):
    if pow5[j]-pow5[i]==N:
      print(*[ls[j],ls[i]])
      f=1
      break
  if f==1:
    break

Submission status: Wrong Answer

Solution code:
i=0
exec('j=-i;exec("i**5-j**5-%sor exit(print(i,j));j+=1;"*i*2);i+=1;'%input()*99)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# べき乗は、a ** n or pow(a, n)
X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、130 , 129

for bi in range(-129,129):
    a = (bi ** 5 + X ) **(1/5)
    if (type(a) == float and a.is_integer) or (type(a) == int):
        if X%(a - bi) == 0:
            print(int(a),int(bi))
            break
    else:
        continue

Submission status: Wrong Answer

Solution code:
i=0
exec('j=-i;exec("i**5-j**5-%sor exit(print(i,j));j+=1;"*99);i+=1;'%input()*200)

Submission status: Wrong Answer

Solution code:
N=int(input())
ls=[i-100 for i in range(201)]
pow5=[n**5 for n in ls]
print(pow5)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# べき乗は、a ** n or pow(a, n)
X = int(input())
# X = a**5 - b**5 
#   = (a-b)(a**4 + a**3 * b + a**2 * b**2 + a * b**3 + b**4)
# よって、X は　a-b　の倍数 X%(a-b) = 0

# a**5  = b**5 + X
#   a   = ( b**5 + X )**(1/5)
# X< 10**9 を満たす a,bの最大値は、130 , 129

for bi in range(-129,129):
    a = (bi ** 5 + X ) **(1/5)
    if (type(a) == float and a.is_integer) or (type(a) == int):
        print(int(a),int(bi))
        break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
x=int(input())
dic={}
for i in range(1,200):
  dic[i**5]=i
  dic[(-i)**5]=-i
for a in range(-118,120):
  for b in range(-119,119):
    if a**5-b**5==x:
      print(a,b)

Submission status: Wrong Answer

Solution code:
def solve():
    x=int(input())
    for i in range(-100,101):
        for j in range(-100,101):
            if(i**5-j**5==x):
                print(i,j)
                return
solve()

Submission status: Wrong Answer

Solution code:
x=int(input())
for i in range(50000):i,j=i//200,i%200-100;i**5-x-j**5or exit(print(i,j))

Submission status: Wrong Answer

Solution code:
x = int(input())
for a in range(-118,119):
    for b in range(-118,119):
        if a**5 - b**5 == x:
            print(a,b)
            exit()

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())
# aは正の数とする
# bが正の場合
max_a = math.ceil(x ** (1/5))
b5 = (max_a ** 5) - x
b = b5 ** (1/5)
if (b.is_integer()):
    print(max_a,int(b))
else:
# bが負の場合
    max_a = math.floor(x ** (1/5))
    for i in range(max_a,-1,-1):
        b5 = x - (i ** 5)
        b = b5 ** (1/5)
        if b.is_integer():
            print(i,int(-1 * b))
            sys.exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
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:
x,r=int(input()),range(-999,9);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x,r=int(input()),range(999,-9);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

Submission status: Wrong Answer

Solution code:
x,r=int(input()),range(-9,999);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())
# aは正の数とする
# bが正の場合
max_a = math.ceil(x ** (1/5))
b5 = max_a ** 5 - x
b = b5 ** (1/5)
if (b.is_integer()):
    print(max_a,int(b))
else:
# bが負の場合
    max_a = math.floor(x ** (1/5))
    for i in range(max_a,0,-1):
        b5 = x - i ** 5
        b = b5 ** (1/5)
        if b.is_integer():
            print(i,int(-1 * b))
            sys.exit()

Submission status: Wrong Answer

Solution code:
x,r=int(input()),range(-99,99);[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

Submission status: Wrong Answer

Solution code:
x,r=int(input()),range(-99,130);[i**5-x-j**5or print(i,j)for i in r for j in r]

Submission status: Wrong Answer

Solution code:
import math
import sys

x = int(input())

# aが正、bが正の場合
max_a = math.ceil(x ** (1/5))
b5 = max_a ** 5 - x
b = b5 ** (1/5)
if (b.is_integer()):
    print(max_a,int(b))
else:
# aが正、bが負の場合
    max_a = math.floor(x ** (1/5))
    for i in range(max_a,0,-1):
        b5 = x - i ** 5
        b = b5 ** (1/5)
        if b.is_integer():
            print(i,int(-1 * b))
            sys.exit()

Submission status: Wrong Answer

Solution code:
## D
X = int(input())
Y = [y**5 for y in range(1000)]
for a in range(0, 1000):
    for b in range(1+a, 1000):
        if Y[a] - Y[b] == X:
            print(a, b)
            exit
        if Y[a] + Y[b] == X:
            print(a, -b)
            exit

Submission status: Wrong Answer

Solution code:
## D
X = int(input())
Y = [y**5 for y in range(1000)]
for a in range(1, 1000):
    for b in range(1+a, 1000):
        if Y[a] - Y[b] == X:
            print(a, b)
            exit
        if Y[a] + Y[b] == X:
            print(a, -b)
            exit

Submission status: Wrong Answer

Solution code:
x=int(input())
r=range(200)
[i**5-x-j**5or exit(print(i,j))for i in r for j in r]

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
r = math.ceil(x ** 0.2)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = abs(bb) ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        break

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)くらいの計算をするので多分計算間に合う？
# う〜〜んなんか違う？
# どうせなら+-1000くらいの範囲にやま貼って解いてたら良かったね
# 120^5-119^5出始めて10**10を超えるので，-120<A<120でやってけばよかった．
# もっと実験をすること！！！！

# Xの約数から(x-y)についてあり得る数を列挙していく
import math
X=int(input())
# X,Yの差が1になったときが最も条件の厳しいとき．それらについて調べてみて，どの程度で５乗の差が10^9になるか

# まず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))+1
    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))+1
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))+1
    # 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())
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == x:
            print(a, b)
            break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
r = math.ceil(x ** 0.2)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        break

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
r = math.ceil(x ** 0.2)
print(r)
def reverse_num(x):
    return r - x
def calc_b(aa):
    bb = aa - x
    bbb = bb ** 0.2
    if bb < 0:
        b = -1
    else:
        b = 1
    return b * int(bbb.real + bbb.imag)
def check(a):
    aa = a ** 5
    b = calc_b(aa)
    if aa - b ** 5 == x:
        print(a,b)
        return True
    else:
        return False
for a in range(r // 2 + 1):
    if check(a) or check(reverse_num(a)):
        break