mathturbator's blog

By mathturbator, 10 years ago, In English

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.me/contest/525/submission/10468918

  • Vote: I like it
  • +4
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Yes I think, but I am not sure.

    • »
      »
      »
      10 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      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()]).