| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 5716 | Sparse Matrix |
|
Description
Implement the Addition and Subtraction operations for Sparse Matrix data structure.
Sparse Matrix means only store the non-zero entries.
The Sparse Matrix data structure uses triple
In each test data contains two Sparse Matrixes.
You have to use the same data structure to output the result of Addition and Subtraction.
Input
Input data contains two Sparse Matrixes.
Each one is represented by Sparse Matrix data structure.
Each Sparse Matrix is a nxm matrix with k non-zero entries.
n is the number of rows. 1≤n≤1000000
m is the number of columns. 1≤m≤1000000
k is the number of non-zero entries. 1≤k≤10000
Output
Output data need contains two Sparse Matrixes.
One is the result of Addition and the other one is the result of Subtraction.
They need to be represented by Sparse Matrix data structure.