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.
are you sure becuase it works when i test your case
I am seeing your comment every where , whould You explain why it would fail?
As many others, the solution fails for n=625, p=2 (the case from the text). Also, C-style cast...
As many others, the solution fails for n=625, p=2 (the case from the text).
Again, the solution like this fails for an example from the text n=695, p=2.
The error comes from static_cast of double power to int.
See an example:
cout << std::pow(5,4) << ' ' << static_cast(std::pow(5,4)) << '\n';
This one fails for an example from the text n=695, p=2