Блог пользователя Tahlil

Автор Tahlil, 13 лет назад, По-английски
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 .

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

13 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
It will be very helpful if someone replies :)
13 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
It'll be great if you post your code on codepad.org and give us just a link to your code.
13 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится
Thanks for your suggestion. I edited it:)
13 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится
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
13 лет назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится
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
  • 13 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
    Thank you very much :) I understand the mistake . Now i am going to correct it :)