General Information for the 2017 ECNA Regional Programming
Note: This is a draft document and it is subject to change.
See the changelog at the bottom of this page for more info.
Input and Output Specifications
The following represents the normal restrictions to input and output. If exceptions are to be made, they will be explicitly stated in the Input or Output sections of the problem descriptions.
- All input will be read from standard input. The data on each line will be separated by a single space. There will be no white space at the beginning or at the end of a line. Blank lines will contain no characters. Tabs will never be used. Note that lines may contain more than 80 characters (not including "newline" characters). It should be obvious what the maximum length of the input lines can be for each problem.
- You will be given information in the problem statement to determine the end of input without the need to test for end-of-file.
- You may assume that all input data will conform to the input specifications of the problem; we will not try to trip you up by giving you bogus input.
- Input data will be restricted so that all integer arithmetic in "reasonable algorithms" will not cause 64-bit integer overflow. Contestants are advised to use type long or long long for all integer calculations, except in those problems where it is obvious that large precision integers (e.g. integers with hundreds of digits) are needed.
- Use type double for all floating-point calculations to avoid round-off problems.
- All output goes to standard output. There should be no additional white space at the beginning or the end of any line. Blank lines should contain no characters. The last line of output should not be a blank line. This means that when requested to "separate items with single spaces" you should not simply follow each item on a line with a space, as that will result in an extra space at the end of the line. Likewise, when requested to "separate output for each problem instance with a blank line" you should not output a blank line after the output of each problem instance.
- When asked to round a value to the nearest integer, you should round down when the fractional part is < 0.5 and round up otherwise. Thus 32.4 rounds to 32, while both 32.5 and 32.6 round to 33. The same applies when asked to round at other digit locations (so 4.6785, when rounded to the nearest thousandth, rounds to 4.679).
A note on the problem descriptions
Most problems will include a sample instance in order to describe the problem and demonstrate what is being asked. Sometimes, but not always, this sample is included in the Sample Input, that is always given at the end of the problem description, along with the corresponding Sample Output. Do not assume that the Sample Input includes the sample instance discussed in the problem.
The compilers used are gcc/g++ 5.4.0 and OpenJDK 1.8.0_91. All standard C/C++ libraries (including STL) and Java API are available, except for those that are deemed dangerous by contest officials (e.g., that might generate a security violation).
In addition, contestants may submit solutions in Python. However, there is no guarantee that judges will have any Python solutions, nor is there a guarantee that any given problem will be amenable to a solution in Python. Python 2 version 2.7.12 and Python 3 version 3.5.2 are available.
Note: In C++ your "main" function must have the return type int. If you use "void main()" your program will not compile.
Languages and JudgingThere are three scripts – compilegcc, compileg++ and compilejava – that are available for compiling your programs. The judges will use these scripts for judging submissions. Please use these scripts instead of running the compilers directly; this will ensure that both you and the judges are compiling with the same language settings.
Resource limits – CPU time and memory space – will be specified for each problem in the problem's specifications.
Each submission will receive one of the following responses.
- Compile Error
- Run Time Error
- Time Limit Exceeded
- Wrong Answer
- Output Limit Exceeded
- Memory Limit Exceeded
- Judge Error
See Judgments for more information on judgments.
This part is being revised and information regarding floating-point values will be available here soon. A general announcement will be made when this information is available.
The contest environment this year is based on Ubuntu 16.04. As such, all of the standard UNIX utilities (ls, mv, cp, etc.) are available.
An image suitable for copying onto a 16GB USB drive is available here. Note that this is not the final release, but a reasonably close approximation. Updates will be posted as they become available.
2 Nov 2014 – Added section on Languages and Judging
24 Aug 2015 – Added Python with caveat to languages
2 Sep 2016 – Revised information to reflect use of Kattis
9 Oct 2017 – Added pre-release image for 2017 contest