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

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

I took part in Codeforces Round 297 (div2) and my solution was judged as "wrong answer on pretest 1". After contest was over I tried to check what was the error but I found that my output and expected output were same but still judged as wrong answer. Can someone tell me why?

http://codeforces.net/contest/525/submission/10468918

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

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

Hi, itseems like you are printing an extra unwanted character at the end : http://researchweb.iiit.ac.in/~chaitanyasai.alaparthi/CF.png

Try custom invocation if you want to know where is the wrong going on.

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

    Is this compiler specific? I ran the same code on ideone and my system and didn't print any extra character.

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

      Yes I think, but I am not sure.

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

      I just ran your submission in the console and saw no extra characters. When I redirected output to a file I saw extra 0x00 byte after 'aecbf'. So I guess some terminals/file editors don't show this byte.

      It's definitely not compiler-specific. Some part of your code outputs 0x00 (maybe from s[s.size()]).