LEBOMBS WA

Problem link: http://www.codechef.com/problems/LEBOMBS/

My solution: http://www.codechef.com/viewsolution/3800311

I found the question quite straight forward and my logic seems quite alright to me. Yet I am getting a WA. I think I am missing out something. Could someone please give me a hint?

i got AC with slight changes.i just increased size of arrays declared.Always declare an array of size greater than given limits.

hers is the AC code: http://www.codechef.com/viewsolution/3800480

1 Like

Thanks @anshkhanna7. Yes, that change led to an AC. But in this problem, when we know that input is within the limits and I declare an array catering to that limit where does it go wrong? When am I accidentally accessing destroy[1000] or building[1000]?