How can I generate hash function for matrix ? or how can we compare if two submatrix are equal or not ?
EDIT : tagging source problem , just to make sure it's not from an ongoing contest | interview.
# | User | Rating |
---|---|---|
1 | tourist | 3803 |
2 | jiangly | 3707 |
3 | Benq | 3627 |
4 | ecnerwala | 3584 |
5 | orzdevinwang | 3573 |
6 | Geothermal | 3569 |
6 | cnnfls_csy | 3569 |
8 | Radewoosh | 3542 |
9 | jqdai0815 | 3532 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 163 |
2 | maomao90 | 160 |
2 | adamant | 160 |
4 | maroonrk | 152 |
5 | -is-this-fft- | 151 |
6 | atcoder_official | 148 |
6 | nor | 148 |
6 | SecondThread | 148 |
9 | TheScrasse | 146 |
10 | Petr | 144 |
How can I generate hash function for matrix ? or how can we compare if two submatrix are equal or not ?
EDIT : tagging source problem , just to make sure it's not from an ongoing contest | interview.
Name |
---|
Auto comment: topic has been updated by __RS__ (previous revision, new revision, compare).
Hash of element $$$a_{i,j}$$$ is equal to $$$a_{i,j}u^iv^j$$$, where $$$u,v$$$ are some random numbers. The hash of a submatrix is equal to the sum of hashes of its elements. You can do row/column translations by simply multiplying by powers of $$$u,v$$$.
thanks a lot