Why are 2x2 matrices that are flattened much faster?

Revision en1, by limabeans, 2020-07-14 20:52:19

I was solving this problem and was getting TLE (3s) when using vector<vector<ll>> as my 2x2 matrix, then I converted it to array<ll,4> and I passed in 500 ms. Why is it so much faster?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English limabeans 2020-07-14 22:58:32 557 Tiny change: 'as TLE so I tried u' -> 'as TLE so at first I tried u'
en1 English limabeans 2020-07-14 20:52:19 289 Initial revision (published)