I am getting wrong answer.kindly help me in finding out the error.
The code is at http://www.codechef.com/viewsolution/4319568
Thank you
I am getting wrong answer.kindly help me in finding out the error.
The code is at http://www.codechef.com/viewsolution/4319568
Thank you
Poor you, well it took me a while. you have declared n as ‘short int’ but you scan it as ‘scanf("%d",&n)’, which is for scanning ints. this generates a warning but alas people ignore warnings. that’s what produced the error.
so what you can do:
Even I learned something new from this.