|
|
вернуться в форумHow I can do it on 0.001? Edited by author 31.10.2008 02:29 Edited by author 16.06.2009 00:42 Mine is O(N^2) How do you do ? I track w0[i][j] as length of longest horizontal stride of a[i][j]==0 starting at i,j (0 if a[i][j]==1), symmetric for w1[i][j]. Now w1[i][j] defines the length to be tested (as 2*w[i][j]+1), this is done by descending downwards. At first it seems to be O(N^3) but due to nature of the pattern you won't descend all that frequently, so I believe it's O(N^2), and it gave 0.001 AC in C++ |
|
|