Language: C++

#include <iostream>
#include <valarray>
#include <cmath>
#include <algorithm>

using namespace std;

typedef valarray<long long> array_t;

valarray<array_t> multiply(valarray<array_t> &A, valarray<array_t> &B){
	valarray<array_t> C(array_t(0,B[0].size()),A.size());
	if(A[0].size() != B.size()) return C;
	for(int i = 0; i < A.size(); i++){
		for(int j = 0; j < B[0].size(); j++){
			for(int k = 0; k < A[0].size(); k++){
				C[i][j] += A[i][k] * B[k][j];
			}
		}
	}
	return C;
}

int main(){
	int n,m,l;
	cin >> n >> m >> l;
	valarray<array_t> A(array_t(0,m),n);
	valarray<array_t> B(array_t(0,l),m);
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			cin >> A[i][j];
		}
	}
	for(int i = 0; i < m; i++){
		for(int j = 0; j < l; j++){
			cin >> B[i][j];
		}
	}

	valarray<array_t> C = multiply(A,B);

	for(int i = 0; i < C.size(); i++){
		for(int j = 0; j < C[0].size(); j++){
			cout << C[i][j];
			if(j == C[0].size() - 1) cout << endl;
			else cout << " ";
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::valarray<std::valarray<long long int> > multiply(std::valarray<std::valarray<long long int> >&, std::valarray<std::valarray<long long int> >&)':
a.cc:11:50: error: call of overloaded 'valarray(int, std::size_t)' is ambiguous
   11 |         valarray<array_t> C(array_t(0,B[0].size()),A.size());
      |                                                  ^
In file included from a.cc:2:
/usr/include/c++/14/valarray:639:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp*, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  639 |     valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/valarray:633:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp&, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  633 |     valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
      |     ^~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:26:40: error: call of overloaded 'valarray(int, int&)' is ambiguous
   26 |         valarray<array_t> A(array_t(0,m),n);
      |                                        ^
/usr/include/c++/14/valarray:639:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp*, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  639 |     valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/valarray:633:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp&, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  633 |     valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
      |     ^~~~~~~~~~~~~
a.cc:27:40: error: call of overloaded 'valarray(int, int&)' is ambiguous
   27 |         valarray<array_t> B(array_t(0,l),m);
      |                                        ^
/usr/include/c++/14/valarray:639:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp*, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  639 |     valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
      |     ^~~~~~~~~~~~~
/usr/include/c++/14/valarray:633:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp&, std::size_t) [with _Tp = long long int; std::size_t = long unsigned int]'
  633 |     valarray<_Tp>::valarray(const _Tp& __t, size_t __n)
      |     ^~~~~~~~~~~~~