A problem package is a zip- or tgz-compressed file containing everything needed to describe a problem in a contest. Each problem has a short name, denoted by <pro> below, which is used to create a unique id for the problem. A problem package usually contains a folder named <pro>, with three subfolders containing the following:
- problem statement — in the doc subfolder
- tests — in the in and out subfolders
- programs — in the prog subfolder
The doc folder must contain a file named <pro>zad.tex, where <pro> is the problem's short name. This LateX file is the problem statement and will be compiled and shown to the contest patricipants.
The in folder should contain some tests which will be used to evaluate the submissions.
Each file in the in folder must be named like <pro>1a.in, <pro>1b.in, <pro>2.in etc. Tests in the group 0 or named like <pro>1ocen.in, <pro>2aocen.in, <pro>2bocen.in are the initial tests (the results will be shown to the user immediately after judging and scored for zero points).
The correct output file for a given test may either already be in the out folder or it has to be generated by running the model solution on the corresponding input file. If there are many correct responses, a checker must be supplied.
The prog folder should contain programs in one of the programming languages supported by SIO2. It should contain the following programs:
- The model solution — the correct solution with time and memory complexity close to the optimal. Its name should follow the pattern: <pro><number>.<ext>, where <ext> is the extension appropriate for the programming language (there can be more than one model solution linked to a problem).
- Slow solutions — correct solutions with worse complexity. Their names should follow the pattern: <pro>s<number>.<ext>.
- Incorrect solutions — Their names should follow the pattern: <pro>b<number>.<ext>
- The test generator (optional) — A program that creates the tests. It must create the same tests every time it is run (if you need pseudorandom numbers, seed the random number generator first). It should create the tests in the directory where it was run. It should be named <pro>ingen.<ext>.
- The result checker (optional) — A program that checks the correctness of the result. It should be named like <pro>chk.<ext>. It will be executed this way:
PROchk in_file file_with_contestant_result file_with_correct_result
It should output the following lines on the standard output:
- first line — OK or WRONG whether the result is correct or not.
- second line (optional) — a comment.
- third line (optional) — a number 1-100 meaning (in %) how many points should the contestant receive.
Sometimes, the task author wants to attach some files, for example example tests, to the problem package. To add an attachment to problem package, create the attachments folder and insert required attachments there. Attachments must have title, so you have to create filename.title file, where filename is your attachment file name.
Warning: when a problem package is uploaded, its attachments cannot be modified or removed. If you want to have an attachment only in some problem instances, attach it to problem instances in the contest after uploading the problem.
Example content of a package
met/doc/metzad.tex met/in/met0.in met/in/met1a.in met/in/met1b.in met/in/met1ocen.in met/in/met2ocen.in met/out met/out/met0.out met/out/met1a.out met/out/met1b.out met/out/met1ocen.out met/out/met2ocen.out met/prog/metingen.cpp met/prog/met.cpp met/prog/met1.pas met/prog/met2.cpp met/prog/metb1.cpp met/prog/metb2.cpp met/prog/mets1.cpp met/prog/mets2.cpp met/prog/mets3.pas