Common engineering data structures and algorithms, such as linear,tree,linked list,graph,greedy,divide and conquer,dynamic programming, backtracking, depth search, breadth search and so on
Hi. Thanks for your repo.
I am new to competitive programming, and on one platform I came across the following problem. I would be grateful for advice in its optimal solution.
Two binary matrices are given. You need to bring them to the same size and count the number of differences. There can be up to 10^6 elements in the matrix.
For example, for the following two matrices
110 11
000
the answer is 8 (the final size is 2x6).
It is clear that they can be reduced to the same size using the Euclidean algorithm, but I have no further ideas.