You are not logged in. Please login at www.codechef.com to post your questions!

×

SPOJ: ALLIZWEL

I am getting WA in this question please help

http://ideone.com/7IqPmS

asked 03 Sep '14, 19:08

japoorv's gravatar image

5★japoorv
29592356
accept rate: 0%

Please indent it, and change long defines to functions to make your code readable.

(03 Sep '14, 19:26) stasszczesniak2★

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){
link

answered 03 Sep '14, 19:48

stasszczesniak's gravatar image

2★stasszczesniak
26216
accept rate: 9%

edited 03 Sep '14, 19:51

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×21

question asked: 03 Sep '14, 19:08

question was seen: 2,109 times

last updated: 03 Sep '14, 19:51