This is regarding cf round 702 div3 problem c.

Question link: Problem - C - Codeforces

My sol:

```
bool iscube1(ll n)
{
for(ll i=1;i*i*i<n;i++)
{
ll x=n-i*i*i;
ll y=cbrt(x);
if(y*y*y==x)
{
return true;
break;
}
}
return false;
}
```

can we solve the above problem in O(1)?I am curious to about it.I read an post in math stack exchange,I didn’t get exactly how to implement that.

I want to know if there is any way that we can do that in O(1)?

math stack exchange post link: Numbers that can be expressed as the sum of two cubes in exactly two different ways - Mathematics Stack Exchange