Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

SPOJ BITMAP. NZEC in JAVA.

$
0
0

here is the problem: http://www.spoj.com/problems/BITMAP/

I'm not using any graph traversal techniques to solve this one like bfs/dfs.


My procedure: I'm using a separate matrix that stores the distances and that will be printed as the final answer. In the separate matrix,the places of the 1's(from the input matrix) will be filled with 0's. then all the cells adjacent to the 0's in the separate matrix will be filled with 1's. similarly all the cells adjacent to the 1's in the separate matrix will be filled with 2's and so on...


here is my attempt: http://ideone.com/tiizaE. This gets an NZEC :( Can any one tell me what is wrong and how it can be fixed?


Viewing all articles
Browse latest Browse all 40121

Latest Images

Trending Articles



Latest Images