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: flag = True

while flag:
    e = int(input())
    if e == 0:
        flag = False
    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
        print(ans)

Python: cubics = [ x * x * x for x in range(101)]
squares = [ x * x for x in range(1000)]
while True:
    x, y, z = -1, -1, -1
    m = 1000000
    e = int(input())
    if e == 0: break
#    for i in range(len(cubics)):
#        if e - cubics[i] < 0:
#            e -= cubics[i - 1]
#            z = i - 1
#            break
#    for i in range(len(squares)):
#        if e - squares[i] < 0:
#            e -= squares[i -1]
#            y = i - 1
#            break
#    x = e
    for cubic in cubics:
        if e < cubic: break
        else: z += 1
        tmp = e - cubic
        #print("tmp:",tmp)
        y = -1
        for squ in squares:
            if tmp < squ: break
            else: 
                x = tmp - squ
                y += 1
                #print(x,y,z)
                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,-1,-1):
        temp=e-z**3
        for y 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: from math import floor

while True:
    e = int(input())
    if e == 0:
        break

    ans = 10 ** 10
    for z in range(floor(e ** (1 / 3)) + 1):
        for y in range(floor((e - z) ** (1 / 2)) + 1):
            x = e - y ** 2 - z ** 3
            if x < 0:
                continue
            ans = min(ans, x + y + z)
    print (ans)

Python: import math

while True:
    e = int(input())
    if e == 0:
        break
    
    m = e + 1
    z = 0
    while z <= e:
        z3 = z ** 3
        if z3 > e:
            break
        y = int(math.sqrt(e - z3))
        x = e - y ** 2 - z3
        m = min(m, x + y + z)
        z += 1
    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: 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


def solve(e):
    k = []
    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.append(z + y + x)
    return sorted(k)[0]


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

        if a == 0:
            break

        print(solve(a))


if __name__ == '__main__':
    main()

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

Python: while True:
    e = int(input())
    if e == 0:
        break
    mz = int( e **(1/3))+1
    L = []
    for k in range(mz+1):
        ek = e-k**3
        if ek < 0:
            break
        j = int(ek**0.5)
        i = ek - j**2
        if i >= 0 and j >= 0 and k >=0:
            L.append((i+j+k))
    print(min(L))

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

from math import sqrt

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

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

Python: import math


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

        ylm = int(math.sqrt(e2))

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

            x = e3
            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: #!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
import math


def solve(e):
    candidates = array.array("L")
    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
            candidates.append(x + y + z)
    return min(candidates)


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 + 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: # your code goes here
#grab
import math
e=int(input())
#e=1250
while e>0:
    z=0
    t=z**3
    f=e-t
    q=math.sqrt(f)
    y=int(q)
    if q-y>0.999999:
        y+=1
    x=y*y
    x=f-x
    m=x+y+z
    while t<=e:
        f=e-t
        q=math.sqrt(f)
        y=int(q)
        if q-y>0.999999:
            y+=1
        x=y*y
        x=f-x
        l=x+y+z
        if l<m:
            m=l
        z+=1
        t=z**3
    print(m)
    e=int(input())

Python: #!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)