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: import sys

inf = 1<<30
lim = 10**5

def solve():
    cubics = [x**3 for x in range(100 + 1)]

    while 1:
        e = int(sys.stdin.readline().rstrip())

        if e == 0:
            return

        ans = inf

        for z, c in enumerate(cubics):
            if c > e:
                break
            y = int((e - c)**0.5)
            x = e - c - y**2
            ans = min(ans, x + y + z)

        print(ans)

if __name__ == '__main__':
    solve()

Python: while True:
    e = int(input())
    if e != 0:
        ans = float('inf')
        for z in range(e):
            r1 = e - z ** 3
            if r1 >= 0:
                for y in range(r1+1):
                    x = r1 - y ** 2
                    if x >= 0:
                        s = z + y + x
                        if ans > s:
                            ans = s
                        else:
                            pass
                    else:
                        break
            else:
                break
        print(ans)
    else:
        break

Python: import math

# 1. z ????±???????
# 2. y ??? ???y**2 < (e - z**3)???????????????y????????§???
# 3. x ??? e - y**2 - z**3
# ?????????e????????????????????????101???
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 ):
        z = i
        y = math.floor(math.sqrt(e - i**3))
        x = e - y**2 - z**3
        if ( (x + y + z) < min_e ):
            min_e = x + y + z

    print(min_e)

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 1:
  n=int(input())
  if not n:break
  m=n
  for z in range(int(n**(1/3))+1):
    y=int((n-z**3)**(1/2))
    x=n-y**2-z**3
    m=min(m,x+y+z)
  print(m)

Python: # ??¶?´?: x + y^2 + z^3 = e
# ????????¨??§???????°???¨?????? x + y + z ????±??????????

import math

# 1. z ????±???????
# 2. y ??? ???y**2 < (e - z**3)???????????????y????????§???
# 3. x ??? e - y**2 - z**3
# ?????????e????????????????????????101???
while True:
    e = int(input())
    if e == 0:
        break

    min_e = e
    for i in range(101):
        if (e - i**3) < 0:
            break;
        z = i
        y = math.floor(math.sqrt(e - i**3))
        x = e - y**2 - z**3
        if ( (x + y + z) < min_e ):
            min_e = x + y + z

    print(min_e)

Python: import sys

inf = 1<<30

def solve():
    while 1:
        e = int(sys.stdin.readline().rstrip())

        if e == 0:
            return

        ans = inf

        for z in range(int(e**(1/3)) + 10):
            rest = e - z**3

            if rest < 0:
                break
                
            y = int((rest)**0.5)
            x = rest - y**2

            ans = min(ans, x + y + z)

        print(ans)

if __name__ == '__main__':
    solve()

Python: while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    while z**3 <= e:
        y=0
        while y **2 <= e - z**3:
            x = e - y**2 - z**3 
            if m > x+y+z: m = x+y+z 
            y+=1
        z+=1
    print(m)

Python: from math import floor, sqrt

cubics = [ x * x * x for x in range(101)]
squares = [ x * x for x in range(1000)]
while True:
    m = 1000000
    e = int(input())
    if e == 0: break
    for z in range(len(cubics)):
        if e < cubics[z]: break
        tmp = e - cubics[z]
        y = floor(sqrt(tmp))
        x = tmp - y ** 2
        m = min(m, x + y + z)
    print(m)

Python: while True:
    e=int(input())
    if e==0:
        break
    m=e
    for z in range(int(e**(1/3))+1):
        temp=e-z**3
        for y in range(int(e**(1/2))+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:
        break
    ans = float('inf')
    max_z = int(e ** (1 / 3) + 1e-6)
    for z in range(max_z, -1, -1):
        y = int((e - z ** 3) ** 0.5 + 1e-6)
        ans = min(ans, e - y ** 2 - z ** 3 + y + z)
    print(ans)

Python: ans_list = []

while True:
    e = int(input())
    if e == 0:
        break
    else:
        ans = float('inf')
        for z in range(e+1):
            z3 = z ** 3
            if z3 <= e:
                for y in range(e-z3+1):
                    y2 = y ** 2
                    if y2 <= e - z3:
                        x = e - z3 - y2
                        s = x + y + z
                        if s < ans:
                            ans = s
                    else:
                        break
            else:
                break
        ans_list.append(ans)

for x in ans_list:
    print(x)

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

Python: def cube(x):
    i=1
    while(True):
        if i**3 >x:
            return i-1
        else:
            i +=1
            
while(True):
    e = int(input())
    if e==0:
        break
    ans = pow(10,16)    

    z_max = cube(e)
    for z in range(z_max+1):
        y = int(pow(e-z**3,1/2))
    
        ans = min(ans,e-y*y+y-z*z*z+z)
    print(ans)

Python: import math


def solve(e):
    k = 2 ** 32
    for z in range(99, -1, -1):
        z3 = z * z * z
        if z3 > e:
            continue
        e2 = e - z3

        ylm = int(math.sqrt(e2))
        xzlm = 3 * z * z + 3 * z + 1

        for y in range(ylm, -1, -1):
            y2 = y * y
            if y2 > e2:
                continue
            e3 = e2 - y2

            xylm = 2 * y + 1
            x = e3
            if x > xylm or x > xzlm:
                continue
            k = min(k, x + y + z)
    return k


def main():
    while True:
        a = int(input())

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()

Python: while True:
    e = int(input().strip())
    if e == 0:
        break
    
    m = e + 1
    y = 0
    while y ** 2 <= e:
        z = 0
        while y ** 2 + z ** 3 <= e:
            x = e - y ** 2 - z ** 3
            m = min(m, x + y + z)
            z += 1
        y += 1
    print(m)

Python: import math

x = 0

while True:
    x = int(input())
    if x == 0:
        break
    ans = 1000000
    for i in range(x+1):
        if i*i*i > x:
            break
        j = math.floor(math.sqrt(x-i*i*i))
        ans = min(ans, i+j+x-i*i*i-j*j)


    print(int(ans))