Submit solution
Points:
100.00 (partial)
Time limit:
0.5s
Memory limit:
512M
Input:
stdin
Output:
stdout
Problem type
Allowed languages
C++, Pascal, Python
In case the statement didn't load correctly, you can download the statement here: Statement
Comments
ai bt làm trên python ko chia sẻ cho mik với mn ik
có ai biết cách làm 20/20 ko? mình mới làm đc 14/20 thôi
khó quá mn ơi
Định nghĩa hai ma trận A và B
A = [[1, 1], [2, 2]] B = [[3, 2], [1, 4]]
Tính tổng hai ma trận
def add_matrices(A, B): result = [[0, 0], [0, 0]] for i in range(len(A)): for j in range(len(A[0])): result[i][j] = A[i][j] + B[i][j] return result
Tính hiệu hai ma trận
def subtract_matrices(A, B): result = [[0, 0], [0, 0]] for i in range(len(A)): for j in range(len(A[0])): result[i][j] = A[i][j] - B[i][j] return result
Tính tích hai ma trận
def multiply_matrices(A, B): result = [[0, 0], [0, 0]] for i in range(len(A)): for j in range(len(B[0])): for k in range(len(B)): result[i][j] += A[i][k] * B[k][j] return result
In kết quả
print("Tổng A + B:") print(addmatrices(A, B)) print("Hiệu A - B:") print(subtractmatrices(A, B)) print("Tích A x B:") print(multiply_matrices(A, B))
chatGPT viết nè sai hết trơn luôn
chatgpt ko uy tín đâu
This comment is hidden due to too much negative feedback. Show it anyway.
dựa vào AI ko tốt đâu
oh no
not good