SPOJ MATRIX

Let's talk about algorithms!

Moderator: Board moderators

Post Reply
srrajesh
New poster
Posts: 23
Joined: Sun Sep 30, 2007 9:02 pm

SPOJ MATRIX

Post by srrajesh »

I am trying to solve this problem at SPOJ

https://www.spoj.pl/problems/MATRIX/

My naive code which is O(n^4) searches exhaustively through all the submatrices and therefore gives TLE.
I think, there must be some O(n^3) algorithm (as the one for maximal submatrix) to solve the problem.
But I am not able to figure out that. Can anyone please help me to solve the problem?

I have been working on this for more than a week with no success and I tried various forums for hints, again with no success. :cry:
I hope this forum will help me to figure out an algorithm to solve the problem! :)

Thanks in advance

Post Reply

Return to “Algorithms”