Dejarik wrote:I'm not a supporter of posting code in the board. However in this case the code works correct in my computer but i don't know what can i do to solve the Output Limit Exceeded received in my submissions of problem 445 - Marvelous Mazes.
Probably you didn't check for a particular type of input. What's strange is that the sample input has such a case, probably you didn't notice that. Anyway here is the problem statement:
If there are multiple digits in a number before a character, then the number of times to repeat the character is the sum of the digits before that character.
Your program doesn't handle this case correctly:
Dejarik wrote:[c]
for(ind=0;ind<lon;ind++){
if(isdigit(source[ind])){
total=total+atoi(&source[ind]);[/c]
atoi converts a string to an integer. This is not what you want!
For example in the sample input you have
11X21b1X
Your program will write 11+1 X, 21+1 blanks and 1 X instead of 2 X, 3 blanks and 1 X
Ciao!!!
Claudio