Strassen algorithm not fast enough for RRFRNDS

c-plus-plus
implementation
python
rrfrnds
time-limit
tle

#1

Reading the editorial for RRFRNDS problem from COOK48 it describes a method to solve the problem using Strassen algorithm, but mine solution using is TLE, may someone help me?

RRFRNDS editorial

If someone have ideas to optimize this in python it would be great!
python implementation of Strassen algorithm

Also I saw some posts asking for references of the Strassen algorithm, this implementation + wikipedia is enough to understand it.

!!EDIT

Apparently it isn’t fast enough in c++ either c++ implementation of Strassen algorithm


#2

did anybody solve this problem using Strassen algorithm?