Why are 2x2 matrices that are flattened much faster?
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?
vector<vector<ll>>
array<ll,4>
Colin X Sam X Shayan | Easy Problems Duel | NAC Warmup #1
Codeforces Round 946 Solution Discussion