- 1. Entrée, impression et numéros
- 2. Numéros entiers et flottants
- 3. Conditions: si-alors-autrement
- 4. Pour boucle avec plage
- 5. Cordes
- 6. Boucle en boucle
- 7. Listes
- 8. Fonctions et récursivité
- 9. Listes bidimensionnelles (tableaux)
- 10. Ensembles
- 11. Dictionnaires
- 12. JavaScript
- 13. HTML5 and CSS
- 14. Responsive Design with Bootstrap
- 15. jQuery
Ad place
Multiply two matrices
Statement
Given three positive integers m, n and r, m lines of n elements, giving an m×n matrix A, and n lines of r elements, giving an n×r matrix B, form the product matrix AB, which is the m×r matrix whose (i,k) entry is the sum A[i][1]∗B[1][k]+⋯+A[i][n]∗B[n][k] and print the result.Advertising by Google, may be based on your interests
In all the problems input the data using input()
and print the result using print()
.
12# Read an integer:# a = int(input())XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
3 4 20 1 2 3XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Saved solutions
Tests
Input | Correct answer | |
---|---|---|
3 4 2 0 1 2 3 4 5 6 7 8 9 10 11 2 3 0 4 5 -1 1 1 | 13 5 45 33 77 61 | |
2 2 2 1 2 3 4 5 4 3 2 | 11 8 27 20 | |
1 1 1 5 7 | 35 | |
4 3 1 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 | 14 32 50 68 |