BOI 2012BOI 2012BOI 2012 logo


Competition Days

The competition days of BOI 2012 are Friday the 4th of May and Saturday the 5th of May. On each competition day there will be one competition round in which the contestants will have five hours to complete three tasks.

There will be a practice round on Thursday the 3rd of May. In the practice round the contestants will have two hours and two practice tasks to get familiar with the contest environment, including their workstations and the evaluation system interface.

The solutions submitted during the practice round will be evaluated, but the results will not be considered in the final ranking.

Competition Equipment

For each competition round each contestant will have a desk with a personal computer. The software available on each computer is as described in the section Contest Environment on the BOI 2012 website. The web browser may only be used to access the material in the workstation and the BOI 2012 evaluation server. No other network access is permitted.

Blank paper will be available in the competition room. Contestants can bring pens, pencils and erasers with them. Using any printed materials (except official BOI 2012 materials), or any electronic devices or data carriers (except official BOI 2012 equipment) is prohibited.

[01-May-2012] If a contestant wants to bring a wired keyboard with USB connector, small mascots or English dictionaries to the competition, these must be submitted to the technical staff during the practice competition day. Any of these will be checked and, if cleared, will be given to the contestant in the first competition day. After the first competition day, the contestant must leave these items on his or her workstation if he or she wants to use them during the second competition day. Once again these will be checked and, if cleared, will be given to the contestant in the second competition day. After the second competition day the contestant must take any of these items with him or her.

The Tasks

The tasks posed at BOI 2012 are intended to be of algorithmic nature. That is, the focus is on designing correct and efficient algorithms.

The Solutions

Unless stated otherwise in the task description, the solution of a task is a program written in the Pascal, C, or C++ language. The source code of each solution must be contained in one file and submitted through the BOI 2012 evaluation system interface.

The program must read input data from the text file with specified name. Programs must not attempt to read any additional data neither from the keyboard nor from files not specified in the task description. Contestants may assume that the input data agrees with the task description.

The input consists of a number of lines, each of them (including the last one) terminated by an end-of-line marker. Input values on each line are separated from each other by single space characters. The structure of input is always such that a contestant does not need to worry about end-of-file conditions.

The program must write output data to the text file with specified name. Output on the screen or contents of any other files will not be evaluated. It is NOT allowed to make working files (files different from output file) during program execution.

Output data must consist of a sequence of items separated by space characters or end-of-line symbols as specified in the task description. Contestants must not add output of their own. Leading and trailing spaces on each line are ignored and any number of spaces may separate two output values on a line.

Input and output file names in the source code must be specified without full path - it must be assumed that files are located in the current directory. File names are case sensitive and in program source code must be written exactly as specified in the task description.

Any of the above conditions may be overridden in the task description.


When contestants enter a competition room at the beginning of a competition round, their computers will be switched on. Competition tasks will be inside envelopes next to the computers. The username and password needed to access the system will be given to each contestant in the envelope with the tasks. Contestants are not allowed to open the envelopes or touch the computers until the start signal is given.

For each contestant, task descriptions as well as technical information (maximum points per task, input and output file names, memory and execution time limits) are presented in English and in his/her native language (if such a translation is prepared by his/her team leader). In case of any discrepancies, the English text is binding and official.

Assistance and Requests

During the competition communication is allowed only with room supervisors and Jury.

Contestants may submit questions and technical support requests.

A contestant may ask a room supervisor for assistance at any time. The supervisors will NOT answer questions about the competition tasks (see the section "Requests" below), but will deliver papers, attend to computer problems, help to find toilets, etc.

If contestants encounter problems with hardware, they can request help form the room supervisor. In case of hardware failure, extra time will be granted to a contestant, but this will cover only the amount of time needed to replace the hardware.

Questions must be submitted using a special form on the BOI evaluation server in English or in the contestant's native language. In the latter case Jury will give answer to the question only after it will be translated into English by the team leader.

The questions should be formulated so that they can be answered with "YES" or "NO". The following standard answers are possible: "YES", "NO", "ALREADY ANSWERED IN TASK DESCRIPTION (DIRECTLY OR UNDIRECTLY)", "NO COMMENT". All questions not related to the text of the competition tasks will be answered "NO COMMENT".

The Jury will answer every question submitted by contestants. This may take some time, so the contestant should continue working while waiting for the answer to a given question. The contestant shall not be involved in the discussion.

In case of similar questions submitted by several contestants, Jury may give an announcement (via evaluation server page "Announcements" or presenting it in competition rooms).

In case if room supervisor can not solve reported problem, he/she must escalate it to Jury.

If it is not possible to solve reported problem online, it is allowed for any member of Jury to came to competition room and clarify/solve reported problem in direct conversation with contestant. Possible direct communication languages are English, Latvian and Russian.

Delivering the Solutions

Contestants submit their solutions using a web-based evaluation system interface.

When a contestant submits a solution, the evaluation system accepts it for official grading only if the solution compiles and solves correctly the example(s) given in the task text. Only the last accepted solution from each contestant is graded for each task. A solution that is not accepted does not replace a previously accepted solution.

Ending the Competition

Contestants will be given a warning both 30 and 10 minutes before the end of the competition. The contestants have to submit their solutions before the end of contest. At the end of contest, the submission system will close automatically.

Evaluation Process

After each round, an evaluation process starts.

Evaluation of a program involves several test runs with confidential input data and special evaluation software. Tests are grouped - i.e. in each test group there is one or several tests. A test run for a program consists of the following steps:

The evaluation will run on separate computers in the configuration described in "Evironment" section.

Programs must not attempt to modify hardware and operating system settings.


After each competition day every team leader will receive detailed results of its team contestants. There will be one hour to check results on evaluation system.

In case of any dissagreement with results team leader may submit written appeal in English.

Subject of appeals may be (but not limited to) disagreement of content of tests provided with task descriptions. In case of incorrect tests, Jury substitutes incorrect tests with correct ones and reevaluates all accepted solutions.

Subject of appeals may NOT be content of correct test and grouping of tests (i.e. inclusion or not inclusion of the particular test in the particular group).

Jury gives answer to each appeal in the written form and gives a short report to team leaders about all appeals received after each contest day.


After competition all contestants are ranked in non-increasing order with respect to their final scores.

Score for gold medal is greatest score where at least 1/12 of contestants has final score equivalent or greater than this. All contestants whose final score is at least score for gold medal will receive gold medal and diploma.

Score for silver or gold medal is greatest score where at least 1/4 of contestants has final score equivalent or greater than this. All contestants whose final score is at least score for silver or gold medal and who are not awarded by gold medal and diploma (as described above) will receive silver medal and diploma.

Score for medal is least score where at most 1/2 of contestants has final score equivalent or greater than this. All contestants whose final score is at least score for medal and who are not awarded by gold or silver medal and diploma (as described above) will receive bronze medal and diploma.

When calculating medal boundaries participants of unofficial (second) host team are not counted as official contestants.

If final score of any member of unofficial(second) host team fits in medal boundaries described above, he will be awarded by corresponding medal and diploma.