Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Feed Pigeons by Juge_Ti
def checkio(N):
r = (6*N)**(1/3)
p = int(r + 1/(3*r))
return p*(p-1)//2 + max(0, N - p*(p-1)*(p+4)//6)
Feb. 20, 2014
Comments: