Can any one explain how the martrix equation is formed HXR?

https://discuss.codechef.com/problems/HXR

Maybe This will help? I haven’t fully explained it, so if you don’t understand than ask.

1 Like

You can refer to my code, also what do u mean by how matrix equation is formed?

1 Like

got this thanks

Does solution which does not use bitset pass all cases? I mean in the contest discussion video I saw the person said that its essential to use bitsets to lower the constant factors by 64 or so. Also I need to learn to use these bitsets.

I tried that first. Tles by a lot ~30 seconds needed.
https://www.codechef.com/viewsolution/32286840