So, in working through the book, I next did problem 10189.
My solution is extremely inelegant, in that I didn’t really pay attention to the chapter, otherwise I would have:
- Made a 100 + buffer x 100 + buffer array and just used that, rather than dynamically allocating, which means I could..
- Not worry about safe bounds checking
Mostly, I was in the “meh, I can solve that one pretty quick in a dirty hack fashion” mindset, so I made a solution that was more complicated than what should have been a dirty hack.
I tried minor changes to fix the problem, but I couldn’t simulate any board it couldn’t solve. Turns out I had an extra newline inserted at the end of the file, and that was all that changed my Wrong Answer to Solved. I didn’t bother paying attention to this. While I have heard that these things can be merciless, I read this in the introduction to the chapter, as an excerpt of potential outcomes from the judge:
- Presentation Error (PE) — Your program outputs are correct but are not presented in the specified format. Check for spaces, left/right justification, line feeds, etc.
As such, I leaned on the judge a bit, assuming it would have bitched if my issue was just one of output formatting. My mistake for leaning on the judge.
Just to verify I’m not overlooking something, I took my working solution and added an extra newline to the end. The result? Wrong Answer. This is not a matter of problem specification that I misunderstood, as the problem only specifies that “There must be an empty line between field outputs.”
So, long story short, the UVa Baylor Judge apparently doesn’t support presentation errors, at least in this very small sampling of its use.
Anyhow, I then used the book’s judge, which is much slower, and provides support for a much smaller subset of the problems, but with more features. Guess what? Presentation error detected off the bat with my first attempt (I grabbed that version for shits and giggles, yay SCM). For speed and variety, I still prefer using the Baylor site, but I now know it’s extremely strict with presentation format, and that it won’t throw me a bone there.
Edit: Fixed links.