I am getting WA in this question please help
Please indent it, and change long defines to functions to make your code readable.
The bug is in line 46 ( < current, not <=)
Second bug is in line 14. If you don’t want to clear mars, pass only reference(&).
Every time you pass mars to function, you are making a new copy.
Just change in line 14 :
int dfs(int x,int y,int len,map<int,map<int,bool> > mars){
To this :
int dfs(int x,int y,int len,map<int,map<int,bool> > &mars){