Sum of matrices
Connect to the TCP Judge
Run your solver locally and connect to the judge. For each test case, send the correct output. When you clear every case, the judge prints the flag.
Sample Test Cases
1 1 1 2
3
1 2 1 2 3 4
4 6
| Input | Output |
|---|---|
1 1 1 2 |
3 |
1 2 1 2 3 4 |
4 6 |
The judge cycles through these cases (and any others configured). Return the exact output for each to earn the flag.
Problem Description
You are given two matrices A and B, your task is to calculate the sum of matrices A and B.
INPUT: the first line contains two numbers N (1≤N≤1000) and M (1≤M≤1000), which are the dimensions of matrices A and B.
Then, in N lines, M numbers are given, the values of matrix A.
Then in N lines, M numbers are given, the values of matrix B.
Print the matrix (A+B).
Login to submit a solution.
Frequently Asked Questions
This is a medium level problem worth 70 points.
This is a coding problem problem in the Coding category.
0 users have successfully solved this problem.
Related Problems
Try these similar problems to improve your skills