Variable Substitutions

From PC2wiki

Jump to: navigation, search

PC² features variable substitutions in a number of locations to provide flexibility in configuring Language and Problem definitions.

Contents

Location

Variable Format

Each variable name is preceded by a open curly brace and colon and ended with a closing curly brace. In the examples that follow each of the variables is shown as it would be placed in the field.

List of Variables

This table's examples assume an input file of hello.c submitted by team 4 at site 5.

Table of Variable Substitution
Name Description Example
{:basename}Name of file without extensionhello
{:mainfile}Name of file hello.c
{:teamid}Team Number4
{:siteid}Site Number 5
{:language}Language Java-7008022922832958176
{:problem}Problem Number A-6037680426662657684
{:timelimit}Problem time limit120

Post Execution Variables

Table of Variable Substitution
Name Description Example
{:exitvalue}Exit/return value of submitted program
{:executetime}Execution time in ms

The exit value is Operating System dependent and should be very well tested before relying on the value (if at all).

Validator Variables

This table's examples assume a data file: sumit.dat, a answer file: sumit.ans, and a validator of gvim.

Table of Variable Substitution
Name Description Example
{:validator} Represents the file name given in the Validator Program box. Note that it is not a required that the 'validator program' actually be an executable program; it could for example be a text file. gvim
{:infile} Represents the problem data input file as configured in the problem. sumit.dat
{:outfile} Represents the output sent to stdout by the team program when it was executed by the judge.
{:ansfile} Represents the judge’s answer file as configured in problem. sumit.ans
{:resfile} Specifies the name of the file into which an active validator must place an XML representation of the judgement.

See Also

Personal tools