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.
- Prepare
- Mathematics
- Fundamentals
- Matrix Tracing
- Discussions
Matrix Tracing
Matrix Tracing
Sort by
recency
|
54 Discussions
|
Please Login in order to post a comment
As others have been saying, the answer numerically should be (m+n-2) choose (m-1) (mod 10^9 + 7). Of course, the problem is the time limit, which you will see if you try this method. Here are the two insights that I needed to solve this:
Dive into the neon grid, dodging digital projectiles like a Moto X3M rider evading obstacles. Matrix Tracing: a mind-bending game of reflexes and precision. Each pulse of light tests your skill, demanding split-second decisions.
For those interested, the technique needed to solve this exercises is close to the implementation of
math.comb
in the Python standard library (albeit using modulo 2⁶⁴ which comes for free if using unsigned integers). You can watch Raymond Hettinger's keynote "Numerical Marvels Inside Python" for more explanations.TLE'd on this but i was thinking somewhere along the lines of the followng:
nc = int(math.factorial(m)//(math.factorial(r)*math.factorial(m-r)))
where r in range(n)My python3 solution but time limit execution