binary search algorithm pattern
$time\ O(logn)$
#include<iostream>
using namespace std;
int main()
{
double n;
cin>>n;
double l=-10000.0,r=10000.0;
while(abs(l-r)>1e-9)
{
double mid=(l+r)/2;
if(mid*mid*mid-n>=1e-9) r=mid;
else l=mid;
}
printf("%.6f",l);
return 0;
}