STONES - Getting WA

My solution for STONES is getting WA. The problem is pretty straightforward and I have tried several test cases. But I am unable to point out why I am getting WA. Can somebody help me find the test case for which it is giving WA?

Thanks!

i think that there is some mistake in the way u r taking input…i just changed fgets to scanf and it got AC…LINK…!!!

1 Like

String input always gives me trouble. Sometimes it requires an additional ‘\n’ in the scanf. But your program does not.Anyway thanks!

glad could help…:slight_smile:

i would suggest using char by char reading of input…this will help u read only things that u need(the way u want it to be read…:P) or that is mentioned in the program statement…u can see my soln…http://www.codechef.com/viewsolution/2402309:slight_smile: