We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #154: Exploring Pascal's pyramid.
Project Euler #154: Exploring Pascal's pyramid.
Sort by
recency
|
6 Discussions
|
Please Login in order to post a comment
It seems we can solve all test cases taking advantage of the symmetry of Pascal pyramid level. Every j element in row i (rows are enumarated from very bottom where i = 0 means bottom row) in level n of Pascal pyramid is given by the formula: n! / (i! * j! * (n - i - j)!). Due to symmetry we need to consider only one third of rows. Last but not least, it's very helpful to precompute given prime exponents in all factorials.
im getting a floating point exception.
if n=0 , p0=1 , α0=0 , p1=1 , α1=0; WHAT SHOULD BE THE OUTPUT FOR THIS INPUT:)
" onmouseover="alert(1)