Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

moss3s's blog

By moss3s, history, 19 months ago, In English,

Hi. I'd like to tell you short story.

Do you like to get outcomes like this?

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

I was bit confused. 46296564

After short experiment i've got OK with exactly? same code: 46298129. Look inside, compare, are the sources same?

The only difference is in BOM (byte order mark, prefix 0xEF,0xBB,0xBF of file).

The first submission is source code in utf-8 with BOM, the second one has no BOM. It turns out, if source code contains BOM, php produces stdout with BOM, and of course checker can not parse it correctly.

Seems to be bug in php.

P.S. Please, don't ask, why php :D

Tags php, bom, fun, bug
 
 
 
 
  • Vote: I like it
  • +117
  • Vote: I do not like it

»
19 months ago, # |
  Vote: I like it +41 Vote: I do not like it

To me, looks like supporting outputs starting with BOM in checkers (via a patch in testlib) is at least worth considering.