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 math
targ = int(input())
while True:
    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
            m = int(math.sqrt(targ - n**3))
            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: 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):
            if e - z**3 < 0:
                break

            for y in range(int((e - z**3)**0.5) + 10):
                x = e - z**3 - y**2

                if x < 0:
                    break

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

        print(ans)

if __name__ == '__main__':
    solve()

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

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: 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 e2 > (y + 1) * (y + 1):
                break
            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: 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
        m = int(math.sqrt(targ - n**3))
        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: from math import floor
while(True):
  e = int(input())
  if e == 0:
    break
  ans = e
  for i in range(0,floor(e ** (1/3))+1):
      j = floor((e - i ** 3)**0.5)
      k = e - i ** 3 - j ** 2 + i + j
      if k < ans:
          ans = k
  print(ans)

Python: '''
JAG Domestic 2007 'Space Coconut Grab'
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2012
'''

ans_list = []

while True:
    e = int(input())
    if e == 0:
        break
    else:
        ans = e
        for z in range(1, e+1):
            z3 = z ** 3
            if z3 < e:
                for y in range(1, 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: # your code goes here
#grab
e=int(input())
while e>0:
    z=0
    while z**3<=e:
        z+=1
    z-=1
    f=z**3
    f=e-f
    y=0
 #   print(f)
    while y*y<=f:
        y+=1
    y-=1
    f-=y*y
    f+=y+z
 #   print(f)
    y=0
    while y*y<=e:
        y+=1
    y-=1
    e-=y*y
    z=0
    while z**3<=e:
        z+=1
    z-=1
    z**=3
    e-=z
    e+=y+z
    if e<f:
        f=e
    print(f)
    e=int(input())

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

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

Python: import math
while True:
    E = int(input())
    if E == 0: break
    ans = 10**10
    z = 0
    while z**3 <= E:
        y = int(math.sqrt(E - z**3))
        x = E - z**3 - y**2
        ans = min(x+y+z, ans)
        z += 1
    print(ans)

Python: def ok(m,e):
    for z in range(m+1):
        if z**3 > e: return False
        for y in range(m-z+1):
            if z**3 + y**2 > e: break
            x = m-z-y
            if z**3 + y**2 + x == 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)

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:break
            if m > x+y+z: m = x+y+z
    print(m)

Python: import math
while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    for z in range(int(math.sqrt(e))):
        for y in range(int(math.sqrt(e))):
            x = e - y*y- z*z*z 
            if x < 0:break
            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))
        xzlm = 3 * z * z + 3 * z + 1

        for y in range(ylm, -1, -1):
            y2 = y * y
            if e2 > (y + 1) * (y + 1):
                break
            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: 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):
        ez = e - z ** 3
        if ez < 0:
            break
        for y in range(floor(ez ** (1 / 2)) + 1):
            x = ez - y ** 2
            if x < 0:
                break
            ans = min(ans, x + y + z)
    print (ans)