Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

sudeepdino008's blog

By sudeepdino008, 10 years ago, In English

The question in short is: You are given a matrix consisting of digits zero and one, its size is n × m. You are allowed to rearrange its rows. What is the maximum area of the submatrix that only consists of ones and can be obtained in the given problem by the described operations?

Problem link: http://codeforces.com/contest/375/problem/B

Tutorial Link: http://codeforces.com/blog/entry/10084

I am having problem understanding the solution. It uses a right[i][j]=number of continuous 1s to the right of input[j][i] and then sorts the right matrix along the columns. I'm not sure how this works. Does sorting according to columns arrives at a particular permutation of rows? How does this work?

  • Vote: I like it
  • 0
  • Vote: I do not like it