Yes, factorial is easy to overflow of int range, and find 563 not pass. So programming based on test result.
amazing
This comment is hidden because it contains spoiler information about the solution
Yes, it is n^3 in fact.
maxSequence([-1,-2,-3]) Out: 0
maxSequence([-1,-2,-3])
Out: 0
I think it is incorrect
I find this:
So I think there are some differences between random_tests and fixed_tests.
C++
Expected: equal to 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988 Actual: 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
And I run it on CodeBlock, add
std::string t = "302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988"; std::cout << ws.orderWeight(t) << std::endl; std::cout << t << std::endl; if(t==ws.orderWeight(t)) std::cout << "same"; return 0;
The output is:
302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988 same
So what can I do?
Loading collection data...
Yes, factorial is easy to overflow of int range, and find 563 not pass. So programming based on test result.
amazing
This comment is hidden because it contains spoiler information about the solution
Yes, it is n^3 in fact.
I think it is incorrect
I find this:
So I think there are some differences between random_tests and fixed_tests.
C++
Expected: equal to 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
Actual: 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
And I run it on CodeBlock, add
The output is:
302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
same
So what can I do?