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.
Markov Chains definitely work, but it may be bottlenecked by the speed of matrix multiplications. The matrix representation will have n^2 x n^2 elements (although there's probably a better way to do it) and you'll have to multiple it by itself many times. For n=40 and m=100 you can expect it to be very slow.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #213: Flea Circus
You are viewing a single comment's thread. Return to all comments →
Markov Chains definitely work, but it may be bottlenecked by the speed of matrix multiplications. The matrix representation will have n^2 x n^2 elements (although there's probably a better way to do it) and you'll have to multiple it by itself many times. For n=40 and m=100 you can expect it to be very slow.