All assignments in A4B33ALG are handled by an assignment upload system BRUTE. Students are supposed to deliver self-contained source codes independent of other than standard libraries. The source codes can be in one of the currently supported languages:

 C or C++, JAVA, Pascal, Python
The easiest way to submit an assignment is to create a .zip archive with required files and structure and upload it to the system (the system interface should be self-explanatory, in case of troubles contact immediately your teacher).

All assignments are automatically evaluated and thus must meet following requirements:

## C, C++

A C,C++ assignment can contain any combination of C and C++ source files. All the source files must reside in the root directory of the archive.

The automated evaluation system compiles all source codes with .c, .cpp and .cxx extensions and links together all object files. One of the source files must contain function main.

## JAVA

A JAVA assignment can contain multiple files with .java extension. File Main.java containing Main class is required. All JAVA classes must reside in alg package. All the files must be placed in alg/ directory. Please be careful with the case of the letters when naming the source files, JAVA is strictly case sensitive (i.e. Main class must reside in Main.java).

During the automated evaluation, system compiles all source codes with .java extension.

## Pascal

All source files must reside in the root directory of the archive. The main program must reside in the file named main.pas.

## Python

All source files must reside in the root directory of the archive. The main program must reside in the file named main.py.

# Public and private data

Each problem assignment in the upload system is associated with the set of public example input and output data. Each time a solution is submitted it is run on the public dataset and the program output to stdout and stderr is available to the student. Public data are accessible at the bottom of the problem statement page and are intended for somewhat easier debugging and approximate program correctness checking. It is in no way meant to be a “litmus paper” of the quality of a particular solution. Sometimes they may hint to potential pitfalls of the particular problem. Nevertheless, each student is encouraged to produce a sufficient number of his/her own debug data sets if necessary.

# Input and output

Your program should read all data from the standard input and write the data to the standard output. Your program has no access to any disk files in the system for security reasons, so do not try to read/write any files, it will produce no effect. The system runs your program as many times as there are input data files associated with the particular problem in the system. Each file contents is redirected to standard input of your code.

Note that some languages contain I/O constructs which are notoriously slow:
In C++, avoid streaming like cout « xyz, use printf() instead.

# Time limits

The system runs your code on each data file separately. In each run, the system executes the reference solution of the problem (written usually by a teacher) immediately before it executes your code. The execution time of the reference code is multiplied by 2 and rounded up to the closest whole second. This value is then set as a time limit of the execution of your code. If your code does not terminate within the time limit the process running your program is terminated and system evaluates this run (on particular data file) as unsuccessful.

# Environment details

Your assignments are evaluated in 64-bit Linux environment. While this should not be a problem in most cases, please keep in mind that UNIX and Windows systems have a different newline conventions.

Compilers used:

GCC version 4.7

>gcc-4.7 --version
gcc-4.7 (Debian 4.7.2-5) 4.7.2

java8

>java8 -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

FPC version 2.2.2

python3.4

Compile and run options:

g++ -std=c++11 -pipe -Wall -O3 -c *.cpp
g++ -std=c++11 -pipe -Wall -O3 -c *.cxx
gcc --std=c99 -pipe -Wall -O3 -c *.c
g++ -std=c++11 *.o -o main
./main

javac8 -Xlint alg/*.java
java8 -Xss50m -Xms64m -Xmx1024m alg.Main

fpc -Cs6000002.2

python3.4