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

Автор thatznikhil, 13 лет назад, По-английски

208A - Dubstep

I am getting right answer for the given test cases for this problem but don't know why on submitting the solution, for the same(i.e. first) test case, the judge says:

Checker comment

wrong answer 1st words differ - expected: 'ABC', found: 'ABC'

This is my submission of the solution: 4452060

Any help regarding this is highly appreciated.

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

»
13 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

I think that your output contains '\n' in the end. But in checker comment it is ignored. May be this '\n' not needed in output

»
13 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

There is an extra space in your output, and i think the checker is space sensitive (it never used to be), look for extra trailing spaces.

  • »
    »
    13 лет назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I also doubted the same, so \b to remove that trailing space, if any present at end.

    See this submission: 4452358

    Even then getting WA.

    See if you can help me out.

    • »
      »
      »
      13 лет назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      cout << '\b' does not erase the last written character. Rather than that, it writes the byte whose value corresponds to the character \b to the output. In ASCII it is character 8.

      It is the terminal software/hardware (on the receiving end, not on the sending end) which recognizes these special characters and then does something accordingly. But if you write data to a file instead of a terminal, the characters will remain as written.

»
13 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

If output (int)a[i] instead of a[i] you can see, that you outputs four characters with codes 65 66 67 0.