Polygon
This page provides a brief introduction to the collaborative problem-setting platform Polygon.
Introduction
What is Polygon
Website: Index Page - Polygon
Polygon is a collaborative problem-setting platform with comprehensive features. Its official description states: "Polygon's mission is to provide a platform for creating programming contest problems."
Setting problems for Codeforces (CF) requires using Polygon. For problem-setting elsewhere, especially in collaborative scenarios, Polygon is also an excellent choice.
Advantages
- Version control system: prevents chaos in collaboration and eliminates the need for file transfers.
- Complete problem-setting system: validator, generator, checker, and solutions are tightly integrated, with automatic output generation.
- Labels for solutions: warnings for incorrect solutions that pass (AC) or correct solutions that fail (not AC), making it easy to eliminate incorrect solutions one by one.
- Convenient stress testing: data from stress tests can be directly added to the problem's test data.
- Issue tracking: allows reporting problems without being overwhelmed by messages while ensuring fixes.
- Preparation for future CF problem-setting.
- ...
Problem List
The problem list displays basic information about each problem, such as the statement, tutorial status, test data generation, and settings for the standard solution, validator, and checker.
You can double-click the "Name" column in the problem list to add notes, such as reminders (e.g., "need to add more tests" or "need to write tutorial") or the planned score distribution for the problem. You can fill this field as needed or leave it empty.
In the "Rev." column, "x/y" indicates the current problem version (x) and the package version (y). If they differ, y will be displayed in red.
In the "Edit session" column: - "Start" means your account has not yet viewed the problem. - "Continue (x) Discard" means your account is at version x of the problem. Clicking "Start" or "Continue (x)" will take you to the problem management interface. Clicking "Discard" will irreversibly discard all your changes and revert to the state before you viewed the problem.
If your account has uncommitted changes for a problem, the entire row in the problem list will turn red.
Problem Management
Most features of Polygon are intuitive and require no special learning; basic English comprehension is sufficient.
Warning
Problem statements cannot use Markdown; only TeX is allowed.
- Invocation is used to test solutions.
- Stress is used for stress testing.
- Test data is generated using generators in the Tests section, and generators are uploaded in the Files section.
General Info
On this page, you can set the problem's time limit, memory limit, problem type, tags, and associated contest.
At the bottom of the page, "statement sketch" and "tutorial sketch" allow you to edit drafts of the problem statement and tutorial. Note that these drafts will not appear in the final statement or tutorial.
Statement
This page is for writing the problem statement and tutorial. You can also use the "Review" button to review the statement, validator, and checker, typically for auditing purposes.
Both the problem statement and tutorial must use TeX syntax, not Markdown. For example, use \textbf{text} instead of **text**. However, Polygon supports only a very small subset of TeX; you can experiment to see what works.
Use the "In HTML" link at the top to view the rendered problem statement and "Tutorial in HTML" to view the rendered tutorial.
To add images to the statement, first upload the image in the "Statement Resource Files" section below, then include \includegraphics{filename.png} in the statement.
Files
"Source Files" is used to store code other than solutions, such as validators, checkers, generators, and interactors for IO-style interactive problems.
If these codes need to include other files, such as Tree-Generator, place them in "Resource Files".
For grader-style interactive problems, refer to the official tutorial.
Checker
testlib.h provides several built-in checkers, briefly described in the selection box. You can also select one and click "View source" to see its code.
If you need to write your own checker, refer to the checker tutorial.
The "Checker tests" section below allows you to add test cases with outputs and expected evaluation results. Click "Run tests" to verify that the checker returns the correct results.
Interactor
Required only for IO-style interactive problems. Refer to the interactor tutorial.
Validator
Validators are used to check the validity of test data. For writing validators, refer to the validator tutorial.
The "Validator tests" section is similar to "Checker tests": provide input and expected validity to test the validator.
Tests
This page is for managing test data.
On Polygon, it is recommended to use a small number of generators with command-line arguments to generate data, rather than writing many generators or modifying the generator for each test case. Only the input needs to be generated; the output is generated automatically.
A "Testset" is a collection of tests. For CF problems, you need to manually add a "pretests" Testset, which must be a subset of "tests".
"Add Test" is for manually adding a test case, typically for sample or small data. Although you can upload data via files, this is not recommended. Data should either be manually entered or generated by a generator with specific parameters.
If "Use in statements" is checked, the test case will become a sample and automatically appear in the problem statement. For custom input/output display in the statement (often used for interactive problems), click "If you want to specify custom content of input or output data for statements click here" and enter the desired content.
The lower part of the Tests page is for entering scripts to generate data, such as generator-name [params] > test-index. You can use generator-name [params] > $ to avoid manually specifying test indices.
Refer to the Polygon tutorial for using Freemarker to batch-generate scripts.
"Preview Tests" allows you to preview generated data.
Stresses
This page is for stress testing.
Click "Add Stress" to add a stress test. "Script pattern" is a script for generating data, where you can use expressions like "[10..100]" to randomly select values within a range.
Run the stress test; if an error is found, it will show "Crashed", and you can add the failing data to Tests with one click.
Solution Files
This page is for uploading solutions to the problem, which can be correct or incorrect. Uploading incorrect solutions makes it easy to eliminate them and serves as a reminder to do so.
Invocations
This page is for running solutions.
Select the code and test points to run. You can then click "View" in the list to see detailed information.
The evaluation status "FL" indicates an error, usually due to invalid data or a crash in the validator/checker/interactor. "RJ" has two cases: one is an "FL" error, and the other is when the solution fails the first test case.
If the runtime is between half and twice the time limit, it will be highlighted in yellow.
If variables in the data do not reach their minimum or maximum values, a reminder will appear at the bottom.
Issues
This section is for reporting issues.
Packages
A Package contains all information about a problem. For CF problems, it serves as the basis for CF evaluation (e.g., if fixes are needed during a contest, updating the package will affect CF). At other times, it can be used for export.
"Verify" tests that all solutions match their labels (AC, WA, TLE), the checker passes checker tests, and the validator passes validator tests.
Manage access
Manage problem permissions.
Sidebar
The first section displays basic information. If anything does not meet specifications (e.g., tests not including pretests, duplicate test points), it will appear in yellow, and hovering over it will show details.
"View changes" allows you to see the revision history. Note that "switch" cannot be used to revert to a specific version; it only allows making non-conflicting modifications based on a version, which is essentially meaningless, so "switch" is effectively read-only.
"Update Working Copy" fetches updates (from others).
"Commit Changes" submits your updates.
During commit, any non-compliant or warning-worthy issues will be listed.
Contest Management
To create a contest, use "New Contest" for easier problem management.
In the contest management page, "Add problems?" in the top-right corner of the problem list adds existing problems to the contest.
"New problem" in the sidebar creates a new problem and adds it to the contest.
"Manage problem access" above shows permissions for each problem, and "Manage developers list" below manages people with access to the contest. Permissions are automatically granted when creating a problem via "New problem" or adding a new developer, but problems added via "Add problems?" do not grant permissions to existing developers.
The sidebar also allows previewing all problem statements, tutorials, validators & checkers, downloading the entire contest package, and renumbering problems.
Conflict Resolution
When multiple users collaborate on Polygon, if the local version of a problem differs from the remote version, and the modified files cannot be automatically merged when fetching the latest version or submitting updates, a conflict (Conflicted) occurs.
After a conflict occurs, Polygon provides a "Resolve conflicts" option in the problem menu, where users can resolve conflicts in the affected files.
本页面最近更新:,更新历史
发现错误?想一起完善? 在 GitHub 上编辑此页!
本页面贡献者:OI-wiki
本页面的全部内容在 CC BY-SA 4.0 和 SATA 协议之条款下提供,附加条款亦可能应用