Go: package main

import (
    "fmt"
    "math"
)

func main() {
    var e int
    for {
        fmt.Scan(&e)
        if e == 0 { break }

        var ans float64 = float64(e)
        for z := 0; z <= 101; z++ {
            for y := 0; y <= 1001; y++ {
                x := e - y*y - z*z*z
                if (0 <= x && x <= 100000) {
                  ans = math.Min(ans, float64(x+y+z));
                }
            }
        }
        fmt.Println(ans)
    }
}

Python: while True:
    e = int(input())
    if e == 0:
        break
    z, ans = 0, float('inf')
    while z ** 3 <= e:
        r = e - z ** 3
        y = int(r ** 0.5)
        x = r - y ** 2
        ans = min(ans, x + y + z)
        z += 1
    print(ans)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

import heapq
import math


def solve(e):
    candidates = []
    for z in range(0, math.floor(math.pow(e, 1.0 / 3.0)) + 1):
        if e < z * z * z:
            break
        else:
            for y in range(0, math.floor(math.sqrt(e - z * z * z)) + 1):
                x = e - z * z * z - y * y
                heapq.heappush(candidates, x + y + z)
    return candidates[0]


if __name__ == '__main__':
    while True:
        e = int(input())
        if e == 0:
            break
        else:
            print(solve(e))

Python: while True:
    e=int(input())
    if e==0:
        break
    m=e
    for z in range(int(e**(1/3)),-1,-1):
        temp=e-z**3
        y=int(temp**(1/2))
        x=temp-y**2
        if x>=0 and (x+y+z<m):
            m=x+y+z
    print(m)

Python: while 1:
  n=int(input())
  if not n:break
  m=n
  for z in range(int(n**(1/3))+1):
    for y in range(int((n-z**3)**(1/2))+1):
      x=n-y**2-z**3
      m=min(m,x+y+z)
  print(m)

Python: from math import sqrt

while True:
    e = int(input())
    if e == 0: break
    m = e
    for z in range(e):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - (y**2 + z**3)
        m = min(m, x+y+z)
    print(m)

Python: def main():
    while True:
        e = int(input())
        if e==0:
            return
        m = e
        z = int(e**(1/3))
        while z >= 0:
            y = int(int(e-z**3)**(1/2))
            while y >= 0:
                x = e - z**3 - y**2
                m = min(m, x+y+z)
                y -= 1
            z -= 1
        print(m)

if __name__ == '__main__':
    main()

Python: import math
targ = int(input())
while True:
    y,z =0,0
    minans = float("inf")
    if (targ ** ( 1 / 3)) == int(targ ** ( 1 / 3)):
        z = int(targ ** ( 1 / 3))
        targ = 0
    elif (targ ** ( 1 / 2)) == int(targ ** ( 1 / 2)):
        y = int(targ ** ( 1 / 2))
        targ = 0
    else:
        for n in range(math.ceil(targ ** ( 1 / 3))):
            if minans == 0:
                break
            for m in range(math.ceil(targ ** ( 1 / 2))):
                if (n ** 3) + (m **2) > targ:
                    break
                if minans > targ - (n ** 3 + m ** 2):
                    minans = targ - (n ** 3 + m ** 2)
                    y,z = m,n
    if minans != float("inf"):
        print(minans + y + z)
    else:
        print(y + z)
    targ = int(input())
    if targ == 0:
        break

Python: #!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    m = int(input())
    if m == 0:
        break
    ans = 10**9
    for i in range(int(m**(1/3))+1):
        y = int((m-i**3)**(1/2))
        x = m - y ** 2 - i ** 3
        ans = min(ans,x+y+i)
    print(ans)

Python: while 1:
    e=int(input())
    if e==0:break
    m,z=10**15,0
    while z**3<=e:
        b=e-z**3
        a=int(b**0.5)
        m=min(m,b+z-a**2+a)
        z+=1
    print(m)

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

import heapq
import math


def solve(e):
    candidates = []
    for z in range(0, math.floor(math.pow(e, 1.0 / 3.0)) + 1):
        for y in range(0, math.floor(math.sqrt(e - z * z * z)) + 1):
            x = e - z * z * z - y * y
            heapq.heappush(candidates, x + y + z)
    return candidates[0]


if __name__ == '__main__':
    while True:
        e = int(input())
        if e == 0:
            break
        else:
            print(solve(e))

Python: while True:
    e=int(input())
    if e==0:
        break
    m=e
    for z in range(int(e**(1/3))+1,-1,-1):
        temp=e-z**3
        for temp in range(int(e**(1/2))+1,-1,-1):
            x=temp-y**2
            if x>=0 and (x+y+z<m):
                m=x+y+z
    print(m)

Python: def main():
    while True:
        e = int(input())
        if e==0:
            return
        m = e
        z = int(e**(1/3))
        while z >= 0:
            y = int(int(e-z**3)**(1/2))
            while y >= 0:
                x = e - z**3 - y**2
                m = min(m, x+y+z)
            y -= 1
        z -= 1
        print(m)

if __name__ == '__main__':
    main()

Python: import math
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(e):
        for y in range(int(math.sqrt(e))+ 1):
            if  e-y**2-z**3+y+z < 0 or e - y**2 -z**3 <0:break
            if m > e-y**2-z**3+y+z: m = e-y**2-z**3+y+z
    print(m)

Python: while True:
    e = int(input())
    if e == 0:
        break
    else:
        ans = float('inf')
        for z in range(e+1):
            z3 = z ** 3
            rest1 = e - z3
            if rest1 >= 0:
                for y in range(rest1+1):
                    y2 = y ** 2
                    rest2 = rest1 - y2
                    if rest2 >= 0:
                        s = rest2 + y + z
                        if s < ans:
                            ans = s
                    else:
                        break
            else:
                break
        print(ans)

Python: while(True):
  e = int(input())
  if e == 0:
    quit()
  i = int(e ** (1/3))
  j = (int(e - i ** 3)**0.5)
  print(e - i ** 3 - j ** 2 + i + j)

Python: while True:
    e=int(input())
    if e==0:
        break
    m=e
    for z in range(int(e**(1/3)),-1,-1):
        temp=e-z**3
        for y in range(int(temp**(1/2)),-1,-1):
            x=temp-y**2
            if x>=0 and (x+y+z<m):
                m=x+y+z
    print(m)

Python: while(True):
  e = int(input())
  if e == 0:
    quit()
  ans = e
  for i in range(0,int(e ** (1/3))+1):
      for j in range(0,int((e - i ** 3)**0.5)+1):
          k = e - i ** 3 - j ** 2 + i + j
          if k < ans:
              ans = k
  print(ans)

Python: while True:
    e = int(input())
    temp = 10**6
    if e == 0:
        break
    for z in range(int(e**(1/3)+1)):
        for y in range(int((e-z**3)**(1/2)+1)):
            x = e-z**3-y**2
            if x+y+z < temp:
                temp = x+y+z
    print(temp)

Python: import math

# z ??¨ y ????±?????????????x????±?????????????
# ?????????????????°????????????e?????????????????? 10^5 ???
while True:
    e = int(input())
    if e == 0:
        break

    min_e = e
    for i in range( math.floor(pow(e, 1.0/3.0)) + 1 ):
        for j in range( math.floor(math.sqrt(e - i**3)) + 1):
            x = e - (i**3) - (j**2)
            y = j
            z = i
            # print(x)
            # print(y)
            # print(z)
            # print("")
            if ( (x + y + z) < min_e ):
                min_e = x + y + z

    print(min_e)

Python: import numpy
while 1:
    e = int(input())
    if  e == 0 :break
    m = e
    for z in range(int(numpy.cbrt(e))+1):
        for y in range(int(numpy.sqrt(e) + 1)):
            if  e-y**2-z**3+y+z < 0 or e - y**2 -z**3 <0:break
            if m > e-y**2-z**3+y+z: m =  e-y**2-z**3+y+z
    print(m)

Python: def ok(m,e):
    for z in range(m+1):
        if z**3 > e: return False
        for y in range(m-z+1):
            x = m-z-y
            if x + y**2 + z**3 == e: return True
    return False

while True:
    E = int(input())
    if E == 0: break
    m = 1
    while not ok(m,E):
        m += 1
    print(m)