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: Runtime Error

Solution code:
x = int(input())
eps = 1e-9
a = 1
while a**5 <= x:
    diff = a**5-x
    if diff < 0:
        diff = abs(diff)
        sign = True
    else:
        sign = False
    if abs(diff**0.2 - round(diff**0.2)) < eps:
        b = round(round(diff**0.2))
        if sign:
            b = -b
        break
    a += 1
print a,int(b)

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	arr = map(lambda x:(x ** 5,x), range(-65,65))
	for u in arr:
		for v in arr:
			if v[0] - u[0] == a:
				return (u[1],v[1])

u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	arr = map(lambda x:(x ** 5,x), range(-55,55))
	
	for u in arr:
		for v in arr:

			if v[0] - u[0] == a:
				return (u[1],v[1])

u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import collections

x = int(raw_input())
def f(a):
	arr = map(lambda x:x ** 5, range(-55,55))
	
	for u in arr:
		for v in arr:

			if v - u == a:
				return (u,v)

u,v = f(x)
print '{} {}'.format(u, v)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
from  math import log

x = int(input())
eps = 1e-9
a = 1
while a**5 <= x:
    diff = a**5-x
    if diff < 0:
        diff = abs(diff)
        sign = True
    else:
        sign = False
    if abs(diff**0.2 - round(diff**0.2)) < eps:
        b = round(round(diff**0.2))
        if sign:
            b = -b
        break
    a += 1
print a,int(b)

Submission status: Runtime Error

Solution code:
X = int(input())
pow5 = [pow(i,5) for i in range(-150,150)]
for a in range(-150,150):
  for b in range(-150,150):
    if pow5[a+150]+pow[b+150] ==X:
      print(a,b)
      break

Submission status: Runtime Error

Solution code:
X = int(input())
pow5 = [pow(i,5) for range(-150,150)]
for a in range(-150,150):
  for b in range(-150,150):
    if pow5[a+150]+pow[b+150] ==X:
      print(a,b)
      break

Submission status: Runtime Error

Solution code:
X = int(input())
pow5 = [pow(i,5) for range(-150,150)]
for a in range(-150,150):
  for b in range(-150,150):
    if pow5[a+150]+pow[b+150] ==x:
      print(a,b)
      break

Submission status: Runtime Error

Solution code:
X = int(input())
pow5 = [pow(i,5) for range(-150,150)]
for a in range(-150,150):
  for b in range(150,150):
    if pow5[a+150]+pow[b+150] ==x:
      print(a,b)
      break

Submission status: Runtime Error

Solution code:
a = int(input())
l = tuple(range(-1 * a, a))

flag = False
for x in l:
  for y in l:
    if (x ^ 5) - (y ^ 5) == a:
      print(str(x) +' '+ str(y))
      flag = False
      break
  if flag:
    break

Submission status: Runtime Error

Solution code:
import sys
X = int(inout())
a = 1
b = 0
for a in rangr(1, 120):
  for b in range(-119, a):
    if pow(a, 5) - pow(b, 5) == X:
      print(a,b)
      sys.exit()

Submission status: Runtime Error

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


def fif_root(arg):
    def root():
        return math.floor(math.pow(x,1/5)*pow(10,10))/pow(10,10)
    return list(map(lambda x: root(x), arg))

def check_integer(arg):
    return list(map(lambda x: x.is_integer(), arg))

a = 0
while (A:= math.pow(a, 5))-math.pow(a-1, 5) <= X:
    #a,-aの時それぞれの5乗根を計算する。
    root = fif_root([abs(X-A), X+A])
    if True in (c := check_integer(root)):
        idx = c.index(True)
        b = int(root[idx])
        if idx == 1:
            a, b = -a, -b
        else:
            if X - A >= 0:
                b = -b
        print(a, b)
        break
    a += 1

Submission status: Runtime Error

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


def fif_root(arg):
    return list(map(lambda x: math.pow(x,1/5), arg))

def check_integer(arg):
    return list(map(lambda x: x.is_integer(), arg))

a = 0
while (A:= math.pow(a, 5))-math.pow(a-1, 5) <= X:
    root = fif_root([X-A, X+A])
    if True in (c := check_integer(root)):
        idx = c.index(True)
        b = root[idx]
        if idx == 1:
            a, b = -a, -int(b)
        else:
            if X - A > 0:
                b = -int(b)
            else:
                b = int(b)
        print(a, b)
        break
    a += 1

Submission status: Runtime Error

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


def fif_root(n):
    return math.pow(n, 1/5)


a = 0
while True:
    A = math.pow(a, 5)
    b = list(map(lambda x: fif_root(x), [abs(X-A), X+A]))
    if True in (c := list(map(lambda x: x.is_integer(), b))):
        idx = c.index(True)
        b = b[idx]
        if ind == 1:
            a, b = -a, -int(b)
        else:
            if X - A > 0:
                b = -int(b)
            else:
                b = int(b)
        break
    a += 1
print(a, b)

Submission status: Runtime Error

Solution code:
import math
X = int(input())
a = 0
A = 0


def fif_root(n):
    return math.pow(n, 1/5)


while A <= X:
    A = pow(a, 5)
    b = list(map(lambda x: fif_root(x), [X-A, X+A]))
    if True in (c := list(map(lambda x: x.is_integer(), b))):
        ind = c.index(True)
        if ind == 1:
            a, b = -a, -int(b[ind])
        else:
            a, b = a, -int(b[ind])
        break
    a += 1
print(a, b)

Submission status: Runtime Error

Solution code:
X = int(input())

go = [i**5 for i in range(1000)]


def foo():
    for i in range(1000):
        for j in range(i, 1000):
            if go[i] - go[j] == X:
                return i, j
        for j in range(1000):
            if go[i] + go[j] == X:
                return i, -j


A, B = foo()
print(A, B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
judeg = 0
for i in range(-200,200):
  for j in range(-200,200):
    if(i**5-j**5==x):
      print(i,j)
      judge += 1
      break
  if(judge == 1):
    break

Submission status: Runtime Error

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x = I()
    i = 0
    while True:
        t = x - i**5
        u = int(t**0.2)
        for j in range(u-1, u+2):
            if j**5 - i**5 == x:
                return JA([j,i], " ")

        t = x + i**5
        u = int(t**0.2)
        for j in range(u-1, u+2):
            if j**5 + i**5 == x:
                return JA([j,-i], " ")
        i += 1

    return -1


print(main())

Submission status: Runtime Error

Solution code:
from sys import stdin
import numpy as np


def main():
    x = int(input())
    a = 1
    while True:
        b = - pow(x - a ** 5, 1/5)
        if b == int(b):
            print(a, int(b))
            break
        a += 1

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
m=5**6
exec(f'i,j=m%128,m>>7;m-=i**5-j**5!={input()}or print(i,j);'*2*m)

Submission status: Runtime Error

Solution code:
x = int(input())

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

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

Submission status: Runtime Error

Solution code:
x = int(input())

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

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

Submission status: Runtime Error

Solution code:
x = int(input())

a = 0
while True:
    bmin = (x + a**5)**0.2
    bpls = (x - a**5)**0.2

    if bmin.is_integer():
        print(a,int(bmin))
        break
    elif bpls.is_integer():
        print(a,int(bpls))
        break
    
    a+=1
    print(a)

Submission status: Runtime Error

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)
			sys.exit()

Submission status: Runtime Error

Solution code:
def calc(n):
    x = 1 << (n.bit_length() + 4) // 5
    y = (4 * x + n // (x ** 4)) // 5
    while y < x:
        x = y
        y = (4 * x + n // (x ** 4)) // 5
    return x
def f(n):
    c = calc(n)
    return c if c ** 5 == n else 0

X = int(input())
for i in range(1 << 10):
    a = f(X + i ** 5)
    if a:
        print(a, i)
        break
    a = f(X - i ** 5)
    if a:
        print(a, -i)
        break

Submission status: Runtime Error

Solution code:
X = int(input())

def diviser(x):
    a = []
    for i in range(1,x+1):
        if x%i == 0:
            a.append(i)
    return a

dvs = diviser(X)


fx = A**5-B**5
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: Runtime Error

Solution code:
X = int(input())

def divs(a, x):
    for i in range(1,x+1):
        if x%i == 0:
            a.append(i)
    return a

dvs = []
divs(dvs,X)


fx = A**5-B**5
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: Runtime Error

Solution code:
import sympy

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: Runtime Error

Solution code:
def main():
    X=int(input())
    start=0
    while(True):
        back=X-pow(start,5)
        A_back=int(pow(back,1/5))

        front=X+pow(start,5)
        A_front=int(pow(front,1/5))
        if(pow(A_back,5)==back):
            A=A_back
            B=-start
            break
        elif(pow(A_front,5)==front):
            A=A_front
            B=start
            break
        else:
            start+=1
    print(A,B)
if __name__=='__main__':
    main()

Submission status: Runtime Error

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**5)):
        print(a, -b)
        break
    elif fsq(x+(b**5)):
        print(a, +b)
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

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)
            exit()

Submission status: Runtime Error

Solution code:
from collections import Counter
n,*a=map(int,open(0).read().split())
l=[0]*n
r=[0]*n
for i,c in enumerate(a):
  l[i]+=c+i+1
  r[i]+=i+1-c
L=Counter(l)
R=Counter(r)
ans=0
for i in range(1,n+max(a)):
  ans+=L[i]*R[i]
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
X = int(input())
flag = False
for ai in range(-119,120):
    for bi in range(-120,119):
    	if ai**5 - bi**5 ==X:
        	print(int(ai),int(bi))
            flag = True
            break
    if flag:
        break

Submission status: Runtime Error

Solution code:
X=int(input())
for i in range(10**4,1):
    for t in range(-1000,1000):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

Submission status: Runtime Error

Solution code:
x = int(input())
a = 0
c = []
if x == 0:
    a = 0
    b = 0
else:
    for i in range(10**4):
        a_5 = i**5
        if a_5 >= x:
            a = i
            break
        else:
            c.append(a_5)
    d = a_5 - x
    a_5_1 = (a-1)**5
    if d <= a_5_1:
        b = c.index(d)

    else:
        a -= 1
        e = x - a_5_1
        b = - (c.index(e))
print(a,b)

Submission status: Runtime Error

Solution code:
A = -119
while A<= 120:
    B = -119
    while B<= 120:
        if A**5 - B**5 == X:
            break
        B += 1
    A+= 1

print('%d %d'%(A, B))

Submission status: Runtime Error

Solution code:
x = int(input())
a = 0
c = []
if x == 0:
    a = 0
    b = 0
else:
    for i in range(10**4):
        if i**5 >= x:
            a = i
            break
        else:
            a_5 = i**5
            c.append(a_5)
    d = a**5 - x
    if d <= (a-1)**5:
        b = c.index(d)

    else:
        a -= 1
        e = x - a**5
        b = - (c.index(e))
print(a,b)

Submission status: Runtime Error

Solution code:
x = int(input())
a = 0
c = []

while a**5 < x:
    a_5 = a**5
    c.append(a_5)
    a += 1
if a**5 == x:
    b = 0
else:
    d = a**5 - x
    if d <= (a-1)**5:
        b = c.index(d)

    else:
        a -= 1
        e = x - a**5
        b = - (c.index(e))
print(a,b)

Submission status: Runtime Error

Solution code:
x = int(input())
a = 0
c = []

while a**5 < x:
    a_5 = a**5
    c.append(a_5)
    a += 1
if a**5 == x:
    b = 0
else:
    d = a**5 - x
    if d <= (a-1)**5:
        b = c.index(d)

    else:
        a -= 1
        d = x - (a**5)
        b = - (c.index(d))
print(a,b)

Submission status: Runtime Error

Solution code:
x = int(input())
a = 0
c = []

while a**5 < x:
    a_5 = a**5
    c.append(a_5)
    a += 1
if a**5 == x:
    b = 0
else:
    d = a**5 - x
    if d <= (a-1)**5:
        b = c.index(d)

    else:
        a -= 1
        d = x - (a**5)
        b = -c.index(d) 
print(a,b)

Submission status: Runtime Error

Solution code:
import collections


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

prime = prime_factorize(x)[0]

a,b = 0,-prime
while True:
    if x == a**5 - (b)**5:
        print(a,b)
        break
    else:
        a += 1
        b += 1

Submission status: Runtime Error

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))+1
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: Runtime Error

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

    # divisors.sort()
    return divisors


X = int(input())
for div in make_divisors(X):
    for b in range(1, 10**9):
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if right == div[1]:
            print(" ".join([a, b]))
            exit()
        b = -b
        a = div[0] + b
        right = a**4 + (a**3)*b + (a**2)*(b**2) + a*(b**3) + b**4
        if abs(right) > div[1]:
            break
        if right == div[1]:
            print(" ".join([str(a), str(b)]))
            exit()

Submission status: Runtime Error

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

    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 lef(a, b):
        return a*a*a*a + a*a*a*b + a*a*b*b + a*b*b*b + b*b*b*b

    def solve(X: int):
        divs = make_divisors(X)
        for d in divs:
            upper = X // d
            
            base = 0
            while(lef(base+d,base) < upper):
                base+=1
            if lef(base+d,base) == upper:
                print(base+d,base)
                return

            base = -(d//2)
            while(lef(base+d,base) < upper) and (base > d-1):
                base -= 1
            if lef(base+d, base) == upper:
                print(base+d, base)
                return

            base = -d
            while(lef(base+d,base) < upper) and (base < -(d//2)+1):
                base += 1
            if lef(base+d, base) == upper:
                print(base+d, base)
                return
    
            base = -d-1
            while(lef(base+d,base) < upper):
                base -= 1
            if lef(base+d, base) == upper:
                print(base+d, base)
                return
        # raise
        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: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    def main():
        X=int(input())
        for a in range(-100,100):
            for b in range(-100,100):
                if pow(a,5)-pow(b,5)==X:
                    return [a,b]
    print(*main())

resolve()

Submission status: Runtime Error

Solution code:
 -*- coding: utf-8 -*-
import math
import sys

X = int(input())

for A in range(-118, 190):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math
import sys

X = int(input())

for A in range(-118, 190):
  for B in range(-119, 119):
    val = math.pow(A, 5) - math.pow(B, 5)
    if(val == X):
      print(A, B)
      sys.exit(0)
~

Submission status: Runtime Error

Solution code:
from itertools import product

x = int(input())
num = [i**5 for i in range(-1000, 1000)]

for a, b in product(num, repeat=2):
    if a - b == x:
        print(int(a**0.2), int(b**0.2))
        break

Submission status: Runtime Error

Solution code:
from itertools import product

x = int(input())

for a, b in product(list(range(-1000,1000)), repeat=2):
    if a - b == x:
        print(int(a**0.2), int(b**0.2))
        break

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(10 ** 9):
    tmp = (x + i ** 5) ** 0.2
    if tmp == int(tmp):
        print(int(tmp), i)
        break
    tmp = (x - i ** 5) ** 0.2
    if tmp == int(tmp):
        print(int(tmp), -i)
        break

Submission status: Runtime Error

Solution code:
N = int(input())
hight = list(map(int, input().split()))

def smaller(n,m):
  if n >= m:
    return m
  else:
    return n

a = 0

for i in range(0,N):
  for j in range(i+1,smaller(N,100)):
    if j-i == hight[i] + hight[j]:
      a = a+1

print(a)

distance = [0]

Submission status: Runtime Error

Solution code:
x = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
import math
for A in range(-10**5,10**5):
    A5 = A ** 5
    B = round(math.pow(x - A5,1/5),0)
    if  A5 == x + int(B) ** 5:
        print(A,int(B))
        quit()

Submission status: Runtime Error

Solution code:
for i in range(-118,120):
    for j in range(-118, i+1):
        if i ** 5 - j ** 5 == x:
            print(i, j)
            exit()

Submission status: Runtime Error

Solution code:
x = int(input())
for i in range(-118, 120):
  for j in range(-119, 119):
    if i**5 - j** = x:
      print(i, j)
      exit(0)

Submission status: Runtime Error

Solution code:
for i in range(10**8):
	for j in range(-10**4,10**4):
    	if i**5 - j **5 :
      		print(i.j)
      		break

Submission status: Runtime Error

Solution code:
#include <stdio.h>
int main(void){
    int minus[1000000000][2] = {0};
    int plus[1000000000][2] = {0};
    int power_5[120] = {0};
    for(int i = 0; i < 120; i++){
        power_5[i] = i*i*i*i*i;
    }
    for(int i = 0; i < 120; i++){
        for(int j = i; j < 120; j++){
            plus[power_5[i]+power_5[j]][0] = j;
            plus[power_5[i]+power_5[j]][1] = i;
            minus[power_5[j] - power_5[i]][0]= j;
            minus[power_5[j] - power_5[i]][1] = i;
        }
    }
    int x = 0;
    scanf("%d",&x);
    if(plus[x][0]==0){
        printf("%d %d",minus[x][0],minus[x][1]);
    } else{
        printf("%d %d",plus[x][0],-plus[x][1]);
    }



    return 0;
}

Submission status: Runtime Error

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

  for i in range(abs(X)):
    ii = i**5
    b = (X - ii)**(0.5**5)
    bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if bb.is_integer():
      if ii - bb== X:
        return str(i) +" " + str(bb)
      else:
        return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:

class abc_166:
    
    def __init__(self):
        pass
    
    def A(self):
        S=input()
        ans= "ARC" if S=="ABC" else "ABC"
        print(ans)
    
    def B(self):
        NK=list(map(int,input().split()))
        d=[]
        A=[]
        
        for i in range(NK[1]):
            d=int(input())
            a = list(map(int,input().split()))
            A.extend(a)
        
        print(NK[0]-len(list(set(A))))  
            
    def C(self):
        NM=list(map(int,input().split()))
        H=list(map(int,input().split()))
        A=[list(map(int,input().split())) for i in range(NM[1])]
        memo=[0]*(NM[0])
        count=0
        
        #メモ配列初期化
        for i in range(len(memo)):memo[i]=H[i]
        #メモ化処理
        for i in A:
            if H[i[0]-1]>H[i[1]-1]:memo[i[1]-1]=H[i[0]-1]
            elif H[i[0]-1]<H[i[1]-1]:memo[i[0]-1]=H[i[1]-1]
            else:
                memo[i[0]-1]=0
                memo[i[1]-1]=0
                
        for i in range(NM[0]):
            if H[i]==memo[i]:count+=1
            else:pass
        print(count)
    
    
    def D(self):
        pass
    
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_166()
    obj.C()

Submission status: Runtime Error

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

  for i in range(int(X ** 0.5)):
    ii = i**5
    b = (X - ii)**(0.5**5)
    bb = b **5
    # print("A   " + str(i) +"   "+  str(i ** 5))
    # print("B   " + str(b) +"   "+str(b**5))
    # print(i+b)
    if bb.is_integer():
      if ii - bb== X:
        return str(i) +" " + str(bb)
      else:
        return str(i) +' ' + str(int(-1*bb))


def main():
  print(solve())

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# coding: utf-8


def solve(*args: str) -> str:
    x = int(args[0])

    ret = None
    for a in range(120):
        for b in range(a, 120):
            a5, b5 = pow(a, 5), pow(b, 5)
            if a5-b5 == x:
                ret = (a, b)
            elif a5+b5 == x:
                ret = (a, -b)

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Runtime Error

Solution code:

n= int(input())
x=0
while True:
    if int((n-(x**5))**(1/5))==(n-(x**5))**(1/5):
        print(-x,int((n+(x**5))**(1/5)))
        break
    if  int((n+(x**5))**(1/5))==(n+(x**5))**(1/5):
        print(x,int((n+(x**5))**(1/5)))
    x=x+1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

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

    return arr


p = factorization(x)
# print(p)
Bas = 0
Aas = 0
for i in range(1):
    _p = p[i][0]
    # print(_p)
    B = 0
    flg = 0
    while True:

        xnew = (B + _p)**5 - B ** 5
        # print(xnew)
        if xnew == x:
            Bas = B
            Aas = B + _p
            break
        if xnew > x:
            if flg == -1:
                B *= 10
                B = min(-_p/2, B)
            else:
                B -= 1
            flg = -1
        else:
            if flg == 1:
                B *= 10
            else:
                B += 1
            flg = 1

print(f'{Aas} {Bas}')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

x = int(input())
s_candidates = []


for i in range(1, x+1):
    if x % i != 0:
        continue
    else:
        for a in range(x):
            b = a - s
            if a**5 - b**5 == x:
                ans_a = a
                ans_b = b
                break
        if t == tmp:
            break

print(ans_a, ans_b)

Submission status: Runtime Error

Solution code:

N ,M = list(map(int, input().split()))
H = list(map(int, input().split()))

AB = []
res = []

for _ in range(M):
    AB.append(sorted(list(map(int, input().split()))))

for i in range(1,N+1):
    for j in range(M):
        if AB[j][0] == i:
            if H[AB[j][0]-1] <= H[AB[j][1]-1]:
                break
    else:
        res.append(i)

print(len(res))