http://www.codechef.com/viewsolution/4347904
in codechef,it says wrong answer for this code although code is working im ny compiler.
You need to print your answer as per the sample output . Notice that after printing the answer for each testcase you are not going to a new line . So change printf("%lld",max)
to printf("%lld\n",max)
.
Also max is declared as an unsigned int but you are using â%lldâ specifier to print it which is used for long long ints . So change unsigned int max
to long long max
There are two mistakes in your code.
- You declared âmaxâ as âunsigned intâ but used â%lldâ in printf
- You need to print a new line after each output
After making corrections here is your accepted code: http://www.codechef.com/viewsolution/4347939
Thanks a lot! I had already spotted the âunsigned intâ error. It was the \n that was giving the problem. Finally it worked!
Thanks a lot! I had already spotted the âunsigned intâ error. It was the \n that was giving the problem. Finally it worked!