Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I was going through problem E editorial . As per my understanding if make matrix for "16" ,
- then initially I will construct matrix for "1" and then "6" and then "16" ,
- normally according to segment tree merge operation.
- Now "1"'s matrix (as per my understanding of your state diagram) should look like :
- __|_____________
- | 0 0 0 0 0
- | 0 0 0 0 0
- | 0 0 1 0 0
- | 0 0 0 0 0
- | 0 0 0 0 0
- and "6"'s matrix should look like :
- __|_____________
- | 0 0 0 0 0
- | 0 0 0 0 0
- | 0 0 0 0 0
- | 0 0 0 1 0
- | 0 0 0 0 1
- and "16"'s matrix should look like :
- __|_____________
- | 0 0 0 0 0
- | 0 0 0 0 0
- | 0 0 1 1 1
- | 0 0 0 1 1
- | 0 0 0 0 1
- Now my main problem is understanding merge operation , will matrix be multiplied
- during concatenation or simply added . Now for that I tried both adding and multiplication .
- Multiplication is leading to definite null matrix . However adding is not leading to "16"'s matrix as
- you can see.
- So which operation is to be applied ?
Add Comment
Please, Sign In to add comment