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

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

Hello everybody,

For a while now I've been using the wonderful opportunity Codeforces provides — making contests in Gym. My contests are private and I use them mostly to test problems I solve, since locally testing (especially on Windows) is very inaccurate.

The wizard that helps you upload everything is very comfortable, however I couldn't find a way to upload my checker on some problems that may require one. By default, a checker that ignores whitespaces and expects solution and output file to be identical is created, however that is not always the checker I want to use. There is an option to add a checker, but I couldn't find anywhere an explanation of what should be the syntax of the checker. I tried writing a few checkers, looking at the default one's code, but all I got were errors.

I was wondering if someone can point me to a link I've missed, or maybe explain what should be the syntax of checkers for problems in Codeforces.

Thank you in advance!

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

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

In Polygon when you edit a problem you can upload your checker (it should use https://code.google.com/p/testlib/) in the 'Files' tab then you can select it in the 'Checker' tab.

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

For easiness, you should create the problem in Polygon (https://polygon.codeforces.com/) and then import it to your Gym. In Polygon, go to Files tab and upload your checker there (include your additional library if you need). In Checker tab you can choose your uploaded checker.

Polygon recommends us to use testlib but you can write a checker without using testlib. It will receive three command line arguments, the first one is path to input file, the second one is path to output file and the last one is path to answer file. Your checker exit-code should be 0 if the output is correct, 1 if it is wrong, 2 if it is a presentation error, 3 if judgement failure occurred (for example, jury doesn't have a solution but contestant does have).