• No results found

6.3 Contest Problems

6.3.1 Defining a Problem

PC2 must be provided with information about the problem set to be used in the contest.

To enter this information, click on the Problems tab at the top of the main Administrator Configure Contest screen. This will produce a display similar to the following:

PC2 Administrator’s Guide 40 http://pc2.ecs.csus.edu/

Note that initially no problems are listed since none have been added to the system. To add a problem, click the Add button. This will produce the “Add New Problem” dialog shown below.

To define a contest problem to the system, perform the following steps using the Add New Problem dialog:

1) Enter the problem name in the top textbox.

2) Enter the value (in seconds) that the system should enforce as the problem run time limit.

3) Enter a “short name” for the problem (this is the unique string by which the problem is known internally in the system).

4) If the problem requires an input data set, click the “Problem Requires Input Data” checkbox and then

PC2 Administrator’s Guide 41 http://pc2.ecs.csus.edu/

a. select either “Stdin” or “File”, depending on whether the problem description tells teams to write their programs to obtain input data from

“standard input” or from a file23, then

b. if the problem is to be tested using only a single data file, use the Browse button to select the data file (see below for how to define a problem which is to be tested using multiple judge’s input data files).

5) If the Judges have provided a single “Answer File” (a file showing the expected output of a program correctly solving this problem), click the “Judges Have Provided an Answer File”

button and then use the Browse button to select the Answer File. (See below for how to define a problem with multiple Judge’s Answer Files.)

6) Select the desired “Display Options” to be applied when the problem is executed and displayed on the Judge client:

o Show the output window – shows the PC2 output window upon completion of execution/validations

o Show Compare – shows the PC2 compare window upon completion of validation o Hide Problem – do not show this problem to the teams (also suppresses showing this

problem on the Scoreboard HTML/output) 7) Click the Add button to save the problem description.

As each contest problem is entered, it will be displayed on the main Administrator screen (when the Problems tab has been selected). To change some previously entered information for a problem, click on the problem row in the main display to select it, then click the Edit button. This will return to the Edit Problem dialog, where changes can be made.

The following additional notes apply when defining a contest problem:

 The Run Timeout Limit value (shown as 30 in the sample screen above but settable to any positive integer number of seconds when the problem is defined) is enforced by PC2. A count-up timer is displayed during program execution so that the Judge can tell how long the program has been executing; when the specified timeout limit is reached the program will be terminated and the Validator judgment will show “No - Time Limit Exceeded”.

The timer also includes a button to allow the Judge to terminate the program at any time.

 The content of the input data file for a problem is stored internally when the Add button is pressed (that is, PC2 makes an internal copy of the file). For this reason, editing the user’s copy of the file will not automatically change the data presented to team programs. To modify the data file for a problem, the contest administrator must EDIT THE PROBLEM and press the Update button. Upon pressing the Update button, a prompt will appear

23 Note that teams can be instructed to write programs which read from “stdin” even though the administrator provides the input data in a file; PC2 arranges that the content of the specified file is available in the current directory at runtime (for the case of reading from a file), or that the content of the file is presented to the program’s standard input channel (if that input selection is specified).

PC2 Administrator’s Guide 42 http://pc2.ecs.csus.edu/

confirming that the file has changed on disk. Answer Yes to the prompt to re-load the data file.

 PC2 automatically associates a “problem letter” with each defined contest problem; the first problem entered becomes “Problem A”, the second problem entered becomes “Problem B”, etc. Since Version 9.7 problems after the 26th defined problem (“Z”) are lettered “AA’, then “AB”, etc. The only place where problem ‘letters’ are actually displayed is on the PC2 scoreboard (which displays the problem letter in lieu of the full problem name).

 All team program output is expected to go to “standard output” (where it is captured by PC2 and saved for display to the Judges). More specifically, there is no mechanism in the current version of PC2 for dealing with programs which are written to send their output to a destination other than “stdout” (for example, programs which send their output to a file).24

 Contest problems in PC2 are global, in the sense that once a problem definition is entered by the Contest Administrator that problem definition is broadcast to all sites. There is no mechanism for having teams at different sites in a multi-site contest see different descriptions of the same problem. If there is some reason that different descriptions are needed for the same problem (for example, if a problem needs to be described differently at different sites due to OS differences), it is necessary to enter the different problem descriptions effectively as different problems. (While this is not very elegant, it is also something that we rarely – virtually never – see in real contests…) Said another way, PC2 views a contest as a set of teams all working on an identical problem set. Note also that contest problems appear in the same order at each site in a multi-site contest.

 Care must be taken when configuring contest problems in one machine environment (say, Windows) and then moving the configured system to a different environment (say, Linux).

In particular, problem files (judge’s data files and judge’s answer files) should not be configured this way. PC2 records the path to configured files; the path will most certainly be different when the configuration is moved to a different platform.

24 There is in principle no reason a contest administrator could not use the PC2 “Validator” capability to effectively examine and process output sent to a file by a team’s program – including displaying that output for the Judges. While this is not the primary intent of the Validator capability, it could be used as an effective workaround for this limitation.

See the Appendix on Validators for details.

PC2 Administrator’s Guide 43 http://pc2.ecs.csus.edu/

Related documents