Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I think
std::floor(result * 1000000) / 1000000;
should work fine. You might want to look at the result before truncating, because 1146652 is rouned up.This comment is hidden because it contains spoiler information about the solution
Thanks for your post!
Real optimization challenge, stuck on it for half a day. But it was amazing how sometimes one line of code can reduce execution time from minutes (or hours, I have never had enough patience to wait for slow version to end) to fracture of a second. Thanks to the author!