Skip to content

Input Validators

John Clevenger edited this page Jun 26, 2022 · 2 revisions

An Input Validator, also called an Input Format Validator, is a program which verifies that a judge's input data file for a specific contest problem is valid.

PC2 provides support for two kinds of Input Validators. First, it contains built-in support for the VIVA Input Validator. Second, it provides support for loading an arbitrary input validator program, called a Custom Input Validator. For Custom Input Validators PC2 supports a user interface, both through interactive configuration and via YAML Contest Configuration files, which provides support for associating an arbitrary Input Validator program with a specific contest problem. The Custom Input Validator interface is based on various CLICS Input Format Validator specifications.

Specifying a Custom Input Validator

A Custom Input Validator program may be loaded into PC2 from an arbitrary file location, or as part of a Contest Data Package (CDP). When an Input Validator is located within a CDP, it is expected to be under the CDP directory.

config/<problem_short_name>/input_format_validators

For example, an Input Validator program named ainputval.exe for a problem with short name "a" should be located as

config/a/input_format_validators/ainputval.exe

Import YAML Values

When specifying an Input Validator via a YAML Contest Configuration file, the following substitution variables may be used in the YAML file. When validating input data files, these variables are substituted on the Input Validator Command Line.

Name Description Example
{:basename} Name of validator without extension hello
{:inputvalidator} Full name of validator hello.c

See Also

PC2 Logo

Clone this wiki locally