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?
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.
Is this compiler specific? I ran the same code on ideone and my system and didn't print any extra character.
Yes I think, but I am not sure.
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()]
).