why is the following showing wrong answer on codechef though it gives the correct answer for the test cases provided and several other cases that i fed into the program.
Here is the question:
@kcahdog i have made the change as u pointed out… but it is still giving wrong answer…
am i missing something else or have i not made the correction properly…
Your correction was right and code should have worked.But dunno why but i had the gut feeling that something was wrong with memset and voila! Here is the accepted code in which i have replaced memset by a simple for loop to initialize to zero : http://www.codechef.com/viewsolution/3267630. Dunno why memset is not functioning properly.