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.
What a horrible kata, are we expected to count here instead of using combinatorics? Edit: nvm, we have to take into account nonsensical input.
Intermediate results are too big for
ull
. Try a different algorithm to compute the same value.Any updates ? :D
Yes, even the sample tests take 3 seconds to complete.
just noticed this, you are attempting to multiply incorrectly.
n(i+1)
should ben * (i + 1)
Hi I got execution timed out in C++ language but in my IDE (Visual Studio 2017) I pass the tests very easily, not sure what is the problem. Does anybody faces the same problem ? I think my solution is efficient enough as i saw on VS.
How did you solve this ? I got the same issue
Very nice solution and simple to understand, congrats!
I have the same issue with this kata on PHP.
PHP :
'Expected' and 'Actual' values in testRandom() differ by 1 * 10^(-12).
For example,
Expected:
5 => -2397.3454670639853
Actual:
5 => -2397.3454670639858
3 and 8 at the end.
So improper testing it invalidates valid kata solutions.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
B1ts It did. Thanks for help, I solved it.
Use the
question
label next time when asking for help. Also please format you code properly when posting here.I checked your code and noticed 2 issues:
1:
vector variable
is not a valid declaration: use vector<...> var ( I don't do much c++, but I believe it's mandatory )2: You're not looking after
n
variable. If your condition succeds, what should happen ton
?I hope this helps.
Sorry, issues are for problem in the kata not for problem in your code (notice at the top of the page how many people passed the kata and the C++ translation). Cheers.
Loading more items...