ALETHIO - Editorial

@kunal361 is that link SIZSbF - Online C++ Compiler & Debugging Tool - Ideone.com broken, nothing is displayed. Maybe it’s due to user’s privacy control.

oops sorry…changed it!!!

you dont print nething when ans in “0”…pls check that case…!!!

@viaan i m also getting wrong answer…even my solution gives 0 for a string consist of all zero’s
plz check my solution CodeChef: Practical coding for everyone

@malaykeshav does your input gives output 9000…???

yes…9000 is correct!!!

thanks… I did change the code to print “0” …

Strange thing i noticed for my program it is giving no output if i have to print single zero. : R0mFoG - Online C++ Compiler & Debugging Tool - Ideone.com

Also for this simple code to no out put: zTR0YP - Online C Compiler & Debugging Tool - Ideone.com

Please help

print a “\n” after 0…i think it will solve the issue!!!

then why am i getting WA…??..:(…plz check my solution…CodeChef: Practical coding for everyone

yeah i have checked all those cases…but still getting WA…CodeChef: Practical coding for everyone

I have the same output for the string. Make sure your output is zero when there is no input- that thing got me stuck the whole time!

thanks … it solved the issue… but still getting WA !!

What exactly do you mean by no input??
The Problem says 1<=|S|<=1000

@bodmas… C23DB34 will your code works for this test case.

@sid_iiita - yu are using long long… yu shuld change your algo… to keep it in string… otherwise your ans will overflow… check this input…
DDDDDDDDDDD66666666666666666666666666666UYIWUYRR
yu are getting WA

wow, you got me on that! The code doesn’t handle that scenario, though it managed to get an AC :slight_smile:

@kashish55 thanxx for help :smiley:
silly of me

i think my approach was simpler than many described here ; I did’nt realise the case of leading zeros until i read this editorial … my approach was to convert contiguous numbers and look for max and in case of letters look nearby for contiguous numbers and compare the newly formed number (with the letter as number 9) with standing maximum. Python takes good care of large numbers/inputs …so yay to python!

I think this solution is much better than editorial, and this is he way we should do it…nice bodmas…

I have modified your code to handle cases like C23DB34.
http://www.codechef.com/viewsolution/2312243