Polygon refers to Codeforces' Polygon.
This package creates a copy of the tests, renames the tests and outputs a string that can be used
for the Score Parameters field (use GroupMin score type) for
Contest Management System (CMS). The renamed tests and the
score parameters capture Polygon's subtasks (groups) and dependencies in CMS.
This code uses problem.xml in the Polygon full package (either Windows or Linux is fine) to retrieve information about subtasks.
- Install this package:
pip install polyconv - Groups may use Polygon's
COMPLETE_GROUPorEACH_TESTpoints policy. - Generate a full package on Polygon for your problem and download the Linux version.
- Run
polyconv polygon_path, wherepolygon_pathis the path to the Polygon full package's root directory (where the foldersstatements/andtests/are). Add the-fflag to overwrite files if they exist. - A new folder
cms_outwill be created inpolygon_path(this can be changed with-o) containing the following:- A folder
tests/containing renamed tests such asinput.01_group.txtandoutput.01_group.txt. - A
.zipfiletests.zipwith the contents in thetests/folder above. - A
score_params.txtfile with the Batch score parameters string. You should copy this to the Score Parameters field in CMS (use GroupMin score type).
- A folder
- To also extract OutputOnly tests, pass
--output-only SUBSTRING. Any test whose group name containsSUBSTRINGremains in the Batch files and is additionally written to:output_only.zip, using extensionlessinput.XXandoutput.XXnames.attachment.zip, using input-onlyinput_XX.txtnames.output_only_score_params.txt, with one GroupMin subtask per output file using that test's Polygon points.- Matching tests are ordered by their original Polygon test number and renumbered from
00. IDs are padded to the selected test count's width, with a minimum of two digits.
- To also create
samples.zip, pass--samples GROUP. This uses exact group matching and renames the selected tests sequentially asinput.01.txt,output.01.txt, and so on. - The Batch score parameters and, when requested, OutputOnly score parameters will also be output to standard output.