Problem:


Score : 400 points

Problem Statement

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

Constraints

1 \leq X \leq 10^9

X is an integer.

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

Input

Input is given from Standard Input in the following format:

X

Output

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

A B

Sample Input 1

33

Sample Output 1

2 -1

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

Sample Input 2

1

Sample Output 2

0 -1



Sample input:
33


Sample output:
2 -1

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def make_divisors(n):
    divisors = []
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def main():
    x=int(input())
    x_lis=make_divisors(x)
    for xx in x_lis:#xの約数
        xx_lis=make_divisors(xx)
        for q in xx_lis:#xの約数の約数
            a=0
            b=a-q
            while a**5-b**5<=x:
                if a**5-b**5==x:
                    print(a,b)
                    sys.exit()
                a+=1
                b+=1
            a=0
            b=q-a
            while a**5-b**5<=x:
                if a**5-b**5==x:
                    print(a,b)
                    sys.exit()
                a+=1
                b-=1
                print



if __name__=='__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

max = 63

a = []
b = []
bm = []
for i in range(max):
    a.append(i ** 5)
    b.append(a[i])
    bm.append(-1 * b[i])

atarget = 0
btarget = 0
for i in range(max):
    for j in range(max):
        if (a[i] == X + b[j]):
            btarget = j
            atarget = i
            break
        if (a[i] == X + bm[j]):
            btarget = j * -1
            atarget = i
            break


print(atarget, btarget)

Submission status: Wrong Answer

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    X = int(input())
    import math
    for i in range(0,10000,2):
        for j in range(-100,100,1):
            if i == j:
                continue
            if (i-j) * (pow(i,4) + pow(i,3)*j + pow(i,2)*pow(j,2) + i*pow(j,3) + pow(j,4)) == X:
                print(i,j)
                exit()
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

Submission status: Wrong Answer

Solution code:
x = int(input())

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

pfs = prime_factorize(x)

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

for pf in pfs:
  for a in range(100):
    b = a - pf
    if (a**5 - b**5 == x):
      print(a, b)
      break

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

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

A_B = prime_factorize(X)
A = 1
while True:
    B = A - A_B
    num = A ** 4 + A ** 3 * B + A ** 2 * B ** 2 + A * B ** 3 + B ** 4
    if X % num == 0:
        print(A, B)
        exit()
    A += 1

Submission status: Wrong Answer

Solution code:
X = int(input())
for a in range(0, 100):
    for b in range(0, 100):
        bp = b
        bm = -b
        if X == a**5 - bp**5:
            print(a, bp)
            exit()
        elif X == a**5 - bm**5:
            print(a, bm)
            exit()

Submission status: Wrong Answer

Solution code:
X = int(input())
p = 1e9

n = 1
C = [0]
while n**5 < p:
    C.append(n)
    n += 1

def check():
    for i in C:
        for j in C:
            if i**5 + j**5 == X:
                print(i, -j)
                return
            elif i**5 - j**5 == X:
                print(i, j)
                break

check()

Submission status: Wrong Answer

Solution code:
import sys
X = int(input())
mylist= []
for i in range(101):
    mylist += [i**5]
    #print(i**5)
#print(mylist)


for m in mylist:
    for mm in mylist:
        if m - mm == X:
            print(mylist.index(m), mylist.index(mm))
            sys.exit()
            print()
        elif m + mm == X:
            print(mylist.index(m), -1*mylist.index(mm))
            sys.exit()

Submission status: Wrong Answer

Solution code:
x = int(input())

q = int(x ** (1/5))
for A in range(-q, q+1):
  B = (A**5 - x)
  if B < 0:
    B = abs(B)**(1/5)
    B *= -1
    B = int(B)
  else:
    B = int(B ** (1/5))
  if A**5 - B**5 == x:
    print(A, B)
    break

Submission status: Wrong Answer

Solution code:
X = int(input())

# Aの数は10**4個ある
# そして二分探索する

nums = [0]
n = 1
while ((n**5) - ((n - 1)**5)) <= X:
    nums.append(n**5)
    n += 1
# print(nums)
ans = None
for num in nums:
    if (X - num) in nums:
        ans = (num, -1 * (X - num))
        break
    elif -1 * (X - num) in nums:
        ans = (num, (X - num))
        break

if ans:
    print(*ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
n = 0
d = [[0 for i in range(100)] for j in range(100)]
for i in range(100):
    d[0][i] = i**5
    d[i][0] = i**5
    if i**5 == x:
        n = i
if n !=0:
    print(n,0)
else:
    for i in range(1,100):
        for j in range(1,100):
            d[i][j] = d[0][j]+d[i][0]
            if d[i][j] > x:
                n = i
                break
            elif d[i][j] == x:
                print(i,-j)
                n = i
                break
        if n == i:
            break

Submission status: Wrong Answer

Solution code:
import math

if __name__ == '__main__':
    x = int(input())
    limit = math.ceil(x ** 0.2) + 100

    for a in range(limit):
        b5 = a ** 5 - x
        if b5 < 0:
            b = abs(b5) ** 0.2 * -1
        else:
            b = b5 ** 0.2
        if b.is_integer():
            print(a, int(b))
            exit(0)

Submission status: Wrong Answer

Solution code:
from math import sqrt

n = int(input())

res = []
x = n
y = 2
while y*y <= x:
    while x % y == 0:
        res.append(y)
        x //= y
    y += 1
if x > 1:
    res.append(x)
if res:
    for i in range(1, int(sqrt(x))+1):
        for j in range(1, int(sqrt(x))+1):
            if i - j == res[0]:
                print(i, j)
                exit()
            if i + j == res[0]:
                print(i, -j)
                exit()
else:
    print(1, 0)

Submission status: Wrong Answer

Solution code:
x=int(input())
a=0
b=0
def f(n):
    n1 = n**(1/5)
    if n1==int(n1):
        return True

l=set()
l.add(0)
i=1
while i**5<2*x:
    i1=i**5
    l.add(i1)
    if i%2==1:
        l.add(-i1)
    i+=1

for i in l:
    b=i
    a=x+b
    if a in l:
        if a!=0 and b!=0:
            a1=(a/abs(a))*(abs(a)**(1/5))
            b1=(b/abs(b))*(abs(b)**(1/5))
            print(int(a1),int(b1))
        elif b==0:
            a1=(a/abs(a))*(abs(a)**(1/5))
            print(int(a1),0)
        else:
            b1=(b/abs(b))*(abs(b)**(1/5))
            print(0,int(b1))
        break

Submission status: Wrong Answer

Solution code:
x  = int(input())
a = 2
b = -10**6
while 1:
    if a**5 -x == b:
        break
    else:
        b += 1
print(a , b)

Submission status: Wrong Answer

Solution code:
import collections
import sys

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

#####

X = int(input())

if X == 0:
  print("0 0")
  sys.exit()

x = abs(X)
c = prime_factorize(x)
c.append(1)
c = sorted(c)
#print(c)


for i in range(len(c)):
  A = 0
  B = c[i] * (-1)
  while True:
    Z = A**4 + ((A**3)*B) + ((A**2)*(B**2)) + (A*(B**3)) + B**4
    #print(A,B,Z)
    if c[i] * Z == X:
      if X < 0:
        print(B,A)
      else:
        print(A,B)
      sys.exit()

    if c[i] * Z > X and B > 0:
      break
    
    A += 1
    B += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

for a in range(0, 10**9):
    bb = X - a**5
    B = bb**0.2

    if isinstance(B, float):
        if B.is_integer():
            print(a, int(B))
            break

    a *= -1
    bb = X - a**5
    B = bb**0.2
    if isinstance(B, float):
        if B.is_integer():
            print(a, int(B))
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

flag =0

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

Submission status: Wrong Answer

Solution code:
x = int(input())
a = 0
b = 0
for i in range(121):
    tmp = (i ** 5 - x)
    flag = True
    #負の値でFalse
    if tmp < 0:
        flag = False
    b_kouho = abs(tmp) **(1/5)
    if (b_kouho).is_integer():
        a = i
        b = -1 * b_kouho
        if flag:
            b *= -1
        break
print("{} {}".format(int(a),int(b)))

Submission status: Wrong Answer

Solution code:
import math


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


def main():
    x = int(input().strip())
    a = 0
    while True:
        a1 = a
        a2 = -1 * a

        b1 = search(a1, x)
        b2 = search(a2, x)

        if b1 == int(b1):
            a = a1
            b = b1
            break
        if b2 == int(b2):
            a = a2
            b = b2
            break
        a += 1
    print('{} {}'.format(int(a), int(b)))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import exit

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

    # divisors.sort()
    return divisors

X = int(input())

lists = make_divisors(X) 

print(lists)

for i in range(-1000, 1000):
    for j in range(-1000, 1000):
        if i - j in lists and i**5 - j**5 == X:
            print(i, j)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

for a in range(1001001001):
    _b = a**5 - x
    if _b != 0 and _b > 0:
        if _b**0.2 == int(_b**0.2):
            print(a, int(_b**0.2))
            break
    elif _b != 0 and _b < 0:
        _b = -1*_b
        if _b**0.2 == int(_b**0.2):
            print(a, -1*int(_b**0.2))
            break

Submission status: Wrong Answer

Solution code:
import sys
import math
import fractions
from collections import deque
from collections import defaultdict
sys.setrecursionlimit(10**7)

X = int(input())

l = []
for i in range(0, 1000):
    l.append(i ** 5)

for i in range(len(l)):
    for j in range(len(l)):
        if l[i] + l[j] == X:
            print(i, j)
            sys.exit()
        if l[i] - l[j] == X:
            print(i, -j)
            sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

def divisors(n):
  res = set()
  for i in range(1, int(n ** 0.5) + 1):
    if n % i: continue
    res.add(i)
    res.add(n // i)
  return res

x = int(sys.stdin.readline().rstrip())

def f(a, b):
    return pow(a, 5) - pow(b, 5)

def binary(d):
    lo, hi = 0, 10 ** 18
    while lo + 1 < hi:
        a = (lo + hi) // 2 
        b = a - d 
        if f(a, b) >= x:
            hi = a 
        else:
            lo = a
    return hi, hi - d

def main():
    diffs = divisors(x)
    for d in diffs:
        a, b = binary(d)
        if f(a, b) == x:
            print(a, b)
            return 

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
X = int(input())

# a-bで割り切れるからa-bをXの約数になるようにする
# a-bはXの倍数、aとbはxで割ったときの余りは等しく

# aとbは-100~+100の中にあると思うので、総当たりしてしまう

flag = False
for a in range(-100,101):
    for b in range(-100,101):
        if a-b == 0:
            break
        if X%(a-b) == 0 and a**5 - b**5 == X:
                flag = True
        if flag:
            break
    if flag:
        break
print(str(a) + ' ' + str(b))

Submission status: Wrong Answer

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x = ii()
l = [0]
i = 0
num = 0
while num < 10**15:
    i += 1
    num = i**5
    l.append(num)
print(l[-1]-l[-2])
l = set(l)
for item in l:
    if item > x:
        if item - x in l:
            print(int(item**0.2),int((item-x)**0.2))
            exit()
    else:
        if x - item in l:
            print(int(item**0.2),int((x-item)**0.2)*(-1))
            exit()

'''
    if x - item in l:#Aがitemでx-itemは-B**5
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
    elif item - x in l:#Aがitemでx-itemはB**5
#        print(item,item-x)
        print(int(item**0.2),int(abs(item-x)**0.2)*(-1))
        exit()
'''

Submission status: Wrong Answer

Solution code:
X=int(input())
i=0
while True:
    x1=(X+i**5)**(1/5)
    x2=(X-i**5)**(1/5)
    if x1==int(x1):
        print(int(x1),i)
        exit()
    elif x2==int(x2):
        print(int(x2),-i)
        exit()
    i+=1
    if i**5>X:
        break

Submission status: Wrong Answer

Solution code:
# coding:utf-8
x = int(input())
a = 0
b = 0

for i in range(2, 40):
    #print(x - i**5)
    if (x - i**5) < 0:
        a = i - 1
        #print(i - 1)
        break
b = int(-((x - a**5) ** (1 / 5)))
print(a, b)

Submission status: Wrong Answer

Solution code:
x = int(input())
l = [x*x*x*x*x for x in range(0, 121)]
for i in range(121):
	for j in range(i+1, 121):
		if l[i] == l[j] + x:
			print(i, end=" ")
			print(j)
			break
		if l[i] + l[j] == x:
			print(j, end=" ")
			print(-i)
			break

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
A = 0
B = 0
for a in range(1000):
    for b in range(1000):
        if (a-10)**5 - (b-10)**5 == X:
            flag = 1
            A = a-10
            B = b-10
            break
        else:
            pass
    if flag == 1:
        break

print(A,B)

Submission status: Wrong Answer

Solution code:
x = int(input())
s = []
flag = 0

for i in range(-100, 100):
    s.append(i**5)

a = -100

for n in s:
    b = -100
    for m in s:
        if n-m == x:
            print(a,b)
            flag = 1
            break
        if flag:
            break
        b += 1

    a += 1

Submission status: Wrong Answer

Solution code:
x = int(input())
i = 0
num = []
for i in range(-99,100):
    num.append(i)
    i += 1
for i in range(199):
    for j in range(199):
        if num[i]**5 - num[j]**5 == x:
            print(num[i],num[j])
            exit()

Submission status: Wrong Answer

Solution code:
import numpy as np

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

X = int(input())
divisors = make_divisors(X)
for d in divisors:
    d1 = d
    d2 = X/d
    solves = np.roots([5, 10*d1, 10*d1**2, 5*d1**3, d1**4-d2])
    
    for s in solves:
        if s == s.conjugate():
            if s.real.is_integer():
                print(int(d1+s.real), int(s.real))
                exit()

Submission status: Wrong Answer

Solution code:
x=int(input())
n=int(x**(1/5))
a=0
b=0
for i in range(n+1):
    for j in range(-1*(n+1),n+1):
        if i**5 - j**5 == x:
            a=i
            b=j
            print(i,j)
            exit(0)

Submission status: Wrong Answer

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    X=int(readline())
    i=0
    li=[0]
    while True:
        i+=1
        if i**5>=100000*X:
            break
        li.append(i)
        li.append(-1*i)
    
    print(len(li))
    flag=False
    for A in li:
        for B in li:
            if A**5-B**5==X:
                print(A,B)
                flag=True
                break
        if flag:
            break

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
x = int(input())
x2 = int(x**0.5)+1

for i in range(1, int(x**0.5)+1):
  if x%i == 0:
    tmp1 = 0
    tmp2 = 0
    a1 = i
    b1 = 0
    a2 = i-1
    b2 = -1
    while tmp1 < x and 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:
X = int(input())

gojo = []
i = 0
ans = 0
while ans <= 1000000000000000000:
    ans = i**5
    gojo.append(ans)
    i += 1

risou = 0
for j, gostart in enumerate(gojo):
    risou = gostart + X
    mirisou = X - gostart
    for k in range(len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou or gojo[k] > mirisou:
            break

Submission status: Wrong Answer

Solution code:
x = int(input())

# fiflist = [i**5 for i in range(-100,100)]
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:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

x = int(input())
if x == 1:
    print("0 -1")
    quit()
p_numbers = prime_factorize(x)
num = p_numbers[0]

for i in range(1000000):
    a = num - i
    b = -1 * i
    if x // num == a ** 4 + (a ** 3) * b + (a ** 2) * (b ** 2) + a * (b ** 3) + b ** 4:
        print(str(a) + ' ' + str(b))
        quit()

Submission status: Wrong Answer

Solution code:
x = int(input())

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

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

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

print("no")

Submission status: Wrong Answer

Solution code:
X = int(input())

yakusu = {1, X}
X_k = X
for i in range(2, int(X**0.5)+1):
    while X_k % i == 0:
        X_k = X_k // i
        yakusu.add(i)
        yakusu.add(X_k)
        
for k in yakusu:
    for A in range(-10000, 10000):
        value = A**5 - (A-k)**5
        if value == X:
            print(A, A-k)
            break

Submission status: Wrong Answer

Solution code:
X=int(input())
l=[]
for y in range(1,X//2+1):
	if X%y==0:
		l.append(y)
K=len(l)
for y in range(0,K):
	KKK=0
	i=0
	A=0
	while KKK<X:
		A=A+1
		KKK=A**5-(A-l[y])**5
	if KKK==X:
		print(A,A-l[y])
		break

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
A = 0
B = 0
for a in range(500):
    for b in range(500):
        if (a-10)**5 - (b-10)**5 == X:
            flag = 1
            A = a-10
            B = b-10
            break
        else:
            pass
    if flag == 1:
        break

print(A,B)

Submission status: Wrong Answer

Solution code:
def foo():
    for i in range(len(F)):
        for j in range(len(F)):
            if F[i] + F[j] == X:
                print(i, j)
                return
            if F[i] - F[j] == X:
                print(i, -j)
                return
X = int(input())
F = [i**5 for i in range(1000)]
flg = False
foo()

Submission status: Wrong Answer

Solution code:
X = int(input().strip())
f = [i**5 for i in range(64)] + [i**5 for i in range(-1, -64, -1)]
ind = [i for i in range(64)] + [i for i in range(-1, -64, -1)]
for i, x in enumerate(f):
    for j, y in enumerate(f):
        if x - y == X:
            print(ind[i], ind[j])
            exit()

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    num = int(input())
    min1 = int(pow(num/2,1.0/5))
    max1 = int(pow(num,1.0/5))
    a=max1
    judge = 1
    while a>=min1:
        b=pow(num-pow(a,5),1/5)
        if(b-int(b)==0.0):
            print(a,-int(b))
            judge = 0
            break
        a-=1
    a=max1
    if judge:
        while pow(a,5)-pow(a-1,5)<=num:
            b=pow(num+pow(a,5),1/5)
            if(b-int(b)==0.0):
                print(a,int(b))
                break
            a+=1

Submission status: Wrong Answer

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

    # divisors.sort()
    return divisors

x = int(input())
for i in make_divisors(x):
    for j in range(-1000, 1000, 1):
        if (j ** 4 + (j ** 3) * (j - i) + (j ** 2) * ((j - i) ** 2) + j * ((j - i) ** 3) + (j - i) ** 4) == x % i:
            print(j, j - i) 
            exit()

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
i = -7000
while True:
  t = math.pow(i, 5)-x
  if t >= 0:
    b = math.pow(t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(b)))
      break
  else:
    b = math.pow(-t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(-b)))
      break
  i += 1

Submission status: Wrong Answer

Solution code:
X = int(input())

num = [-1, 1]
tmp1 = 0
tmp2 = 0
for i in range(101):
    for j in range(101):
        for k in num:
            for l in num:
                if((k*i)**5-(j*l)**5 == X):
                    print(i*k, j*l)
                    exit()

Submission status: Wrong Answer

Solution code:
import math
import itertools

X = int(input())

list = [0]

for i in range(1000):
    val = i**5
    list.append(val)

if X % 2 == 0 and X // 2 in list:
    print(int(math.pow(X//2, 1/5)), -int(math.pow(X, 1/5)))
elif X in list:
    print(int(math.pow(X, 1/5)), 0)
else:
    for i in itertools.combinations(list, 2):
        # print(i)
        if i[0] + i[1] == X:
            print(int(math.pow(i[0], 1/5)), -int(math.pow(i[1], 1/5)))
            break
        elif i[0] - i[1] == X:
            print(int(math.pow(i[0], 1/5)), int(math.pow(i[1], 1/5)))
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

gojo = []
i = 0
ans = 0
while ans <= 1000000000000000000:
    ans = i**5
    gojo.append(ans)
    i += 1
print(len(gojo))
risou = 0
for j, gostart in enumerate(gojo):
    risou = gostart + X
    mirisou = X - gostart
    for k in range(len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou or gojo[k] > mirisou:
            break

Submission status: Wrong Answer

Solution code:
X = int(input())

# a-bで割り切れるからa-bをXの約数になるようにする
# a-bはXの倍数、aとbはxで割ったときの余りは等しく

# aとbは-100~+100の中にあると思うので、総当たりしてしまう

flag = False
for a in range(-100,100):
    for b in range(-100,100):
        if a-b == 0:
            break
        if X%(a-b) == 0 and a**5 - b**5 == X:
                flag = True
        if flag:
            break
    if flag:
        break
print(str(a) + ' ' + str(b))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
x2 = int(x**0.5)+1

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

X = int(input())
divisors = make_divisors(X)
for d in divisors:
    d1 = d
    d2 = X/d
    solves = np.roots([5, 10*d1, 10*d1**2, 5*d1**3, d1**4-d2])
    
    for s in solves:
        if s == s.conjugate():
            if s.real.is_integer():
                print(d1+s.real, s.real)
                exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(a, b):
    return pow(a, 5) - pow(b, 5)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = ii()
    for a in range(101):
        for b in range(101):
            if X == f(a, -b):
                print(a, -b)
                exit()
            if X == f(a, b):
                print(a, b)
                exit()
            if X == f(-a, b):
                print(-a, b)
                exit()
            if X == f(-a, -b):
                print(-a, -b)
                exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

x = int(input())
minus = x < 0
if minus:
    x = x * -1
for a in range(1000000000):
    b = ((a**5) - x)**0.2
    if isinstance(b, float) and b.is_integer():
        if minus:
            print(a * -1, int(b) * -1)
        else:
            print(a, int(b))
        break
    b = (x - (a**5))**0.2
    if isinstance(b, float) and b.is_integer():
        if minus:
            print(a * -1, int(b))
        else:
            print(a, int(b) * -1)
        break

Submission status: Wrong Answer

Solution code:
x = int(input())

import math

a = math.floor(math.pow(x, 1 / 5))
bp = a ** 5 - x

b = math.ceil(math.pow(abs(bp), 1 / 5))
if bp < 0:
    b = -b

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

Submission status: Wrong Answer

Solution code:
# coding:utf-8
x = int(input())
a = 0
b = 0

for i in range(2, 40):
    #print(x - i**5)
    if (x - i**5) < 0:
        a = i - 1
        print(i - 1)
        break
b = int(-((x - a**5) ** (1 / 5)))
print(a, b)

Submission status: Wrong Answer

Solution code:
X = int(input())
flag = 0
A = 0
B = 0
for a in range(300):
    for b in range(300):
        if (a-10)**5 - (b-10)**5 == X:
            flag = 1
            A = a-10
            B = b-10
            break
        else:
            pass
    if flag == 1:
        break

print(A,B)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = n % 10

judge = False
if m == 0:
  n = n // 10**5
  m = n % 10
  judge = True
  
def calc(a, b):
  return a**5 - b**5
  
lst = []
for i in range(-1000, 1000):
  lst.append(calc(i+m, i))
  
for i in range(0, 2000):
  if lst[i] == n:
    if judge:
      print((i - 1000 + m)*10, (i - 1000)*10)
    else:
      print(i - 1000 + m, i - 1000)
    break

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
i = -70
while True:
  t = math.pow(i, 5)-x
  if t >= 0:
    b = math.pow(t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(b)))
      break
  else:
    b = math.pow(-t, 1/5)
    if b.is_integer():
      print(str(i) + ' ' + str(int(-b)))
      break
  i += 1

Submission status: Wrong Answer

Solution code:
import math
x = int(input())
for i in range(-1,(10**2)+1):
    dum = (x+(i**5))**(1/5)
    #print(dum)
    if dum % 1 == 0:
        print(math.ceil(dum), i)
        break

Submission status: Wrong Answer

Solution code:
X = int(input())

gojo = []
i = 0
ans = 0
while ans <= 1000000000000000000:
    ans = i**5
    gojo.append(ans)
    i += 1
print(len(gojo))
risou = 0
for j, gostart in enumerate(gojo):
    risou = gostart + X
    mirisou = X - gostart
    for k in range(len(gojo)):
        if gojo[k] == risou:
            print(k, j)
            exit()
        elif gojo[k] == mirisou:
            print(k, -j)
            exit()
        if gojo[k] > risou or gojo[k] > mirisou:
            break