The tags of this problem include binary search

It is correct.
pseudocode :low = 0; high = sum of all negative energy while(low<high){ mid = (low+high)/2; if(canReachBottom(mid)){ high = mid; }else{ low = mid; } } return low;
Read this article on binary search(especially from Beyond arrays: the discrete binary search) : http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch