Q. What languages & platforms will be used for the contest?
C++, C, Java, and Python are supported. The machines in the lab are running RedHat Linux on an x86 platform.
Q. What do I submit?
A single source file which (if correct) solves the problem.
The source file name has very specific constraints:
- The base name should be probN, where N is the problem number.
- The extension should be .cc for C++ programs, .c for C programs, .java for Java programs, and .py for Python programs.
Thus, a C++ submission for problem 3 should be named prob3.cc.
All programs should be command-line tools that produce no output to the screen. Instead, each program will accept a single command-line argument that identifies the name of the input file. This file will have an extension
.dat. The program will produce an output file that has the same name as the input file but will use an extension of.out. Thus, if the program for problem 2 is given an input file with the nameprob2.dat, it will produce an output file calledprob2.out.
Q. How do we edit/compile/run our code?
The easiest editor is probably pico, which you can run by typing:
pico filename
at the command prompt. emacs and vi have (many) more features, but also have steeper learning curves.
To compile a C program:
gcc -g -o probN probN.c
To run a C program in the current directory:
./probN
To compile a C++ program:
g++ -g -o probN probN.cc
To run a C++ program in the current directory:
./probN
To compile a Java program:
javac -classpath . probN.java
To run a Java program in the current working directory:
java -classpath . probN
To run a Python program (there is no compilation step with Python) in the current working directory:
python probN.py
Q. How do we test our code?
Here's a checklist:
- Does it work correctly against the sample data? Use diff myoutputfile.out exampleoutputfile.out to make a detailed comparison. Case and spacing matters!
- Does it work correctly against additional test cases?
- Does it generate any additional output? Turn off any debugging statements before submitting the problem.
- Does it use the correct input/output file names?
Q. How do we debug our code?
gdb is a command line debugger for C and C++ programs and jdb provides similar functionality for Java programs.
Q. How do we submit a problem?
Type the following command:
~kena/bin/acmsubmit filename
Thus, to submit a Java-based submission of problem 1, you would type:
~judge1/bin/acmsubmit prob1.java
Q. When we submit a problem, what should we expect back?
The time it takes to judge a problem depends on how busy the judges are and how hard it is to judge your specific submission. Once your submission is judged, your team should receive one of the following responses:
- CORRECT! Be happy!
- Presentation Error You failed to follow the instructions for submitting your program; for example, you submitted it under a wrong file name. A presentation error is typically detected before any attempt to compile the submitted program.
- Syntax Error Submitted program will not compile or link.
If the submission resulted neither in Presentation Error nor in Syntax Error, the judges will first attempt to run the submitted program on the sample input data provided in the problem statements, then on additional input data. Along with any error verdict consequent to running the program, the judges will indicate whether the verdict is based on a run using sample input data or additional input data. In the latter case, it can be assumed that the run on sample input data was successful.
- Run-Time System Error Running the program resulted in a system error message or malfunction.
- Time-Limit Exceeded The program took too long to run. This usually occurs if your program goes into an infinite loop. All programs for this contest should complete execution within seconds of being launched.
- Incorrect Output There are three sub-categories:
- Format Error Examples of format errors are: a misspelled word, a missing or extraneous blank space or blank line, an upper / lower case inversion error, etc. Typically, format errors affect those components of the output which the judges expect to be hard-wired into the program.
- Numerical Content Error Numbers which the judges expect to be computed by the program are wrong.
- Non-Numerical Content Error Any case of incorrect output which does not fall into one of the two previous sub-categories.
Q. How do we clarify a problem?
Raise your hand and a judge will come talk to you.
Q. How is the contest scored?
Contestants are first ranked by number of correct solutions: the more problems completed, the higher the rank.
Contestants that have finished the same number of problems are then ranked by fewest penalty points: the fewer points, the higher the rank. The penalty points accrued is the sum of:
- 20 points for each incorrect submission of a problem that was eventually submitted correctly by your team.
- The number of minutes from the start of the contest to the submission time of the correct solution to a problem.
Example: The contest starts at 10:00 am; Team Zorbo turns in problem 1 correctly at 10:43, makes two incorrect submissions of problem 2 before submitting a correct solution at 12:35, and makes 3 incorrect submissions for problem 3 without ever turning in a correct solution. The Zorbos would have 225 penalty points, broken down in the following table:
Problem Submission Penalty Time Penalty Total 1 0*20 = 0 0:43 = 43 43 2 2*20 = 40 2:25 = 145 185 Total 2*20 = 40 3:08 = 188 225 Note that there is no penalty accrued for problem 3, since it was never submitted correctly.