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.
Solved using Monte Carlo! The accuracy required is not insanely high (just the integral part) and the number of nodes is reasonably small (<=30), leaving plenty of time to run the simulation many times (I could do it 500,000 times using C++ under the time limit) stochastically to find an approximate average. I'm not sure if this is the intended way, though.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Connect the country
You are viewing a single comment's thread. Return to all comments →
Solved using Monte Carlo! The accuracy required is not insanely high (just the integral part) and the number of nodes is reasonably small (<=30), leaving plenty of time to run the simulation many times (I could do it 500,000 times using C++ under the time limit) stochastically to find an approximate average. I'm not sure if this is the intended way, though.