Subscribed unsubscribe Subscribe Subscribe

0w1

Hi everyone, please feel free to have discussions with me!

HR Find the Seed ( DP + Matrix Inverse - Gauss Elimination )

https://www.hackerrank.com/challenges/find-the-seed F( n ) = c( 1 ) * F( n - 1 ) + c( 2 ) * F( n - 2 ) .. + c( n ) * F( 0 ) => c( n ) * F( 0 ) = F( n ) - c( 1 ) * F( n - 1 ) - c( 2 ) * F( n - 2 ) .. - c( n - 1 ) * F( 1 ) => F( 0 ) = invers…

CFR 450 B. Jzzhu and Sequences ( Adhoc or Fast matrix multiplication )

Problem - B - Codeforces Well, though it did not take me much time, it is really silly that I did not realize the sequence will eventually become periodic, thus it is possible to write a solution in less then 10 lines with O( 1 ) time comp…