Any hint on exponential notation; or should I use full notation (which hasn't worked for me)?
Code: Select all
n --> #
2 --> 6
3 --> 20
4 --> 70
5 --> 252It is currently Sat Sep 05, 2026 12:06 am
Code: Select all
n --> #
2 --> 6
3 --> 20
4 --> 70
5 --> 252It doesn't have to be. Often with these problems the key is to work out a way of not doing things repeatedly.juvan wrote: So I think that this problem, is basically just the discovery of a mathematical formula, or am I mistaking??
It's perfectly fine if you don't come up with solutions completely on your own - part of the value of these problems is to learn from other sources toojuvan wrote:I got the solution to my little "translated" problem (with r's and d's), and I found it while looking at something called the Pascal's triangle, it gave me the mathematical formula to solve it, and it was very neat and short and sweet (though I couldn't in my life time have came up with it on my own), but this way, using the formula, it was all combinatorics, it wasn't really an algorithm doing some sweet computations
(for i.e. making a "map" of the grid and then going about it). And making an algorithm for this problem, I think would need, what I said previously, "some highly optimized clever mathematical algorithm"... Because the sheer amount of possible routs is incredibly huge. So I think that this problem, is basically just the discovery of a mathematical formula, or am I mistaking??
Thanks for the warm welcomeit's a sweet site, and I sure am happy to have found it.
Cheers.

Wow, I really need to fix my implementation then. It's very short and clean but it takes minutes on large grids.TripleM wrote:Less than a millisecond.
Code: Select all
snip