I find Problem E to be very interesting, as it can be solved by modeling with graph theory on matrices. However, it seems there are many different ways to approach this problem. Could everyone share their insights? Or perhaps provide some problems that help in learning such skills? Thank you very much.
personally i didn't model it to a graph,instead i solved it by
backtracking on the operations and comparing them to B
note:i solved separately for every bit
here is my submission 298383591
my time complexity is
O(nm*log(max ai)*log(n+m))
I divided the problem to solving for every bit
Then what i saw is if i want to correct a position i might need to change a whole row or column, which can trigger new changes in other places, I can do them but then it can change other people ect...
So the question is given that i need to trigger changes in some specific places am i gonna be able to do all the changes that will be triggered, or will it go into an infinite loop? Thats when I understood i could model "triggering" as an edge in a graph and it became checking for a cycle with an operation i must do in it