Handled's blog

By Handled, history, 8 years ago, In English

First things first, I'm so sorry because of my bad english, if have any confusions in wording. Thanks :)

Okay, here we go !

Step 1:

You have to prepare problems for contest. Have many ways to do this, but i recommended using polygon system — The professional way to prepare programming contest problem.

  • Create an account on polygon system.

  • After login, you'll see Dasboard Screen like this

  • Choose tab New Problem

  • Start Edit Session

Step 2:

General Info

  • Input file — input file name or "stdin" in case of standard input

  • Output file — output file name or "stdout" in case of standard output

  • Time limit — time limit per test in milliseconds

  • Memory limit — memory limit in megabytes

Statement

  • Prepare problem content here:

Files

  • Resources — Header files, library files and other files you need in process of compilation of your sources. All resources will be copied to the compilation folder while compilation. Also some system files are resources. For example, "problem.tex" (which will be renamed) is also resources. You can change these files if you want to change some system behavior.

  • Sources — Source files of generators, checkers (verifiers) and validator. As since you can change resources and make your sources uncompilable, it is possible to that sources are compilable with the button "Check sources for compilability". You can use one of the prewritten checker (special program which checks that answer is correct), so don't write your own if you really don't need it.

  • Additional files — Any other files. It can be problem manual in Microsoft Word format, some reports in Microsoft Excel or pictures. You can place here problem statement if you have non-standard statement format (for example, Microsoft Word).

Checker

  • Here you can select one of the prewritten checker or any of your sources to play checker role. Checker is a special program which uses three command line parameters: "check.exe input-file output-file answer-file". Checker should read and analyze these files and return verdict. It should return:

    • Exit code 0 — If the answer is correct

    • Exit code 1 — If the answer is incorrect

    • Exit code 2 — If it can't parse output-file

    • Exit code 3 — If some assertion failed (for example participant has found better solution that jury expects).

  • Also it is good practice than checker prints some short message to stdout describing the reason for the verdict. It is better to use English for it.

  • The best way to prepare checker is to use testlib library from the testlib Latest release of the testlib is placing in the resources by default to make easy testlib usage.

Validator

  • Validator is a special program to validate that all the tests are satisfy the constraints from the statement. It expects to get input file from the standard input. If it thinks that input is incorrect, it should return non-zero exit code and prints short message to the stdout or stderr.

  • It is highly recommended to use validator. Validator will be transparently executed on each test usage (sample tests injecting into the statement, solution invocation, test preview and so on).

Tests

  • Each problem has one or more testset. Many problems have only one testset and the typical name for it is "tests". But there are some cases than you need several testsets (for official testing and for internal testing). Each testset contains 1-based enumerated tests. Polygon will check enumeration and write warning message if enumeration is invalid.

  • You have three ways to add tests:

    • Use "Add Test" form — it is good way to manual test.

    • Use Script — script contains lines like "gen 45 | permute > 33" which will create test 33 using generators "gen" and "permute".

  • You should have sources "gen" and "permute" on the files tab. First, the "gen" executable will be invoked with the command line parameter "45". After it the output will be redirected to "permute" executable. The standard output from the "permute" execution will be used as test 33. You don't need "> test-index" part if you use script line on the "Add Test" form.

    • Use "Add tests from archive" feature — upload ZIP file with the tests. Polygon will use all the files in the archive as test files. It will automatically set test indexes.

  • Each test has several setting such as:

    • Use in statements — inject the test (with answer) input the statements;

    • Description — just for information to describe the test specific;

    • Output in statements — raw text which will be included into statements as answer instead of solution generated.

  • Tests page also contains "Preview Tests" link. You should use it if you want to preview all the tests (and answers) on the single page. It will use correct model solution to generate test answers.

For example:

If you use igen.cpp, test script you should write is:

igen [parameter] > $

Solution Files

  • On the "Solutions" tab you can upload solution source files. Each solution file has type (or tag) associated with it:

    • Main correct solution — it is the model solution to generate all answers

    • Correct solution — it is the correct solution, you will be notified if it returns verdict different from OK

    • Incorrect — it is the incorrect solution, you will not be notified for any solution behavior

    • Time limit exceeded — you will be notified if it runs with verdict different from OK and TL

    • Wrong Answer — you will be notified if it runs with verdict different from OK and WA

    • Wrong answer — you will be notified if it runs with verdict different from OK and WA

    • Presentation error — you will be notified if it runs with verdict different from OK and PE

    • Memory limit exceeded — you will be notified if it runs with verdict different from OK and ML

    • Failed — you will be notified if it runs with verdict different from OK and RE (run-time-error)

Innovations

Select the solutions and tests you want to run. On this page you can see detailed reports about invocations. Invocation rows in grid are highlighted if at least one solution got unexpected verdict on at least one test.

Manage Access

Importantly, you need set permission for Codeforces to read your problem.

Packages

Packages are ZIP-files containing problem files in some special format. Typically packages are used by Online Judges. Polygon supports flexible model for packaging. In future versions you will be able to select the package format, but now we are using popular format.

Package contains compiled sources, but doesn't contain generated tests. To generate tests in package run "doall.bat" inside the package.

You can't create package if you have changes in your edit session. Commit the changes before package creation.

Step 3:

Now, you've already completed prepare problem for mashup contest. Then, login to codeforces. Choose Gym > Mashups > Create new mashups — Fill information

Paste problem URL into text box, codeforces'll auto define your problem and add to mashups contest. Find URL problem here :

After click "Create Mashups Contest", you can edit contest's information or Invite users.

That's all, hope you enjoy with codeforces !

Full text and comments »

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