Products of matrices P88905


Statement
 

pdf   zip   main.cc   main.py

Write a function that, given two matrices @a@ and @b@, computes their product.

Interface

C++
typedef vector< vector<int> > Matrix;
    Matrix product(const Matrix& a, const Matrix& b);
MyPy
Matrix: TypeAlias = list[list[int]]
    def product(a: Matrix, b: Matrix) -> Matrix

Precondition

@a@ is a matrix p×qp\times q and @b@ is a matrix q×rq\times r, with p,q,r1p,q,r\ge1.

Information
Author
Jordi Petit
Language
English
Translator
Carlos Molina
Original language
Catalan
Other languages
Catalan
Official solutions
C++ Python
User solutions
C++ Python