Tahlil's blog

By Tahlil, 14 years ago, In English
It says for test case 8 in the checker log " wrong output format Unexpected end of file - token expected ".
What does that mean?? And i couldn't understand why my code gives wrong output . And i am sure that the problem is in the function prn() where the move operations are printed. Can any one please help?

Thank you .

  • Vote: I like it
  • 0
  • Vote: I do not like it

14 years ago, # |
  Vote: I like it +1 Vote: I do not like it
It will be very helpful if someone replies :)
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
It'll be great if you post your code on codepad.org and give us just a link to your code.
14 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it
Thanks for your suggestion. I edited it:)
14 years ago, # |
  Vote: I like it +1 Vote: I do not like it
Everything's clear in this checker message.
Your program just doesn't print all of the moves, although it outputs the right number of them in the first line
14 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it
Mistake is somewhere here:
for(i=0;i<str1.size();i++)
        dp[i][0]=i;
for(j=0;j<str2.size();j++)
        dp[0][j]=j;

For cases, when you need only insert or only delete you count the number of operations correctly,
but you don't memorize those operations and don't output them.
Your code fails at testcases like:
A
AAAAAA
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    Thank you very much :) I understand the mistake . Now i am going to correct it :)