This page is located in archive.

Rozvrh na FEL Posluchači ALG Odevzdávací systém BRUTE Diskusní fórum

Assignment Upload System

All assignments solutions 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 solution 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 solutions are automatically evaluated and thus must meet following requirements:

C, C++

A C,C++ assignment solution 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.


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 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.


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


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

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 Java, avoid class Scanner, use a buffered reader instead.
In C++, avoid streaming like cout « xyz, use printf() instead.

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.


The system generates an evaluation page containing log of the process. Do pay attention to the time limits shown in the log and to the information about each private data set size/parameters. Utilize this information to improve your code efficiency if necessary.

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 -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  
 python 3.6

Compile and run options:

g++ -std=c++14 -pipe -Wall -O3 -c *.cpp
g++ -std=c++14 -pipe -Wall -O3 -c *.cxx 
gcc --std=c99 -pipe -Wall -O3 -c *.c 
g++ -std=c++14 *.o -o main
javac8 -Xlint alg/*.java 
java8 -Xss50m -Xms64m -Xmx1024m alg.Main

fpc -Cs6000002.2

python 3.6

Testing in Docker

If you want to get the exact environment in which the tasks are evaluated, run your code in a Docker container based on image https://hub.docker.com/r/brute/brute_python_jdk8_cpp . Tutorials on Docker usage can be easily found on the web. You'll basically want to execute something like

  docker run -it --rm -v /my/path/to/code/on/host brute/brute_python_jdk8_cpp bash

to get an interactive bash console inside the virtual container. The `-v` parameter shares the given path from the host computer to the container, so that you can easily share the code you wrote on the host.

If the task has some limits, you can reproduce them in this container, too. Total solution runtime can be limited by

  timeout 1s ./main <pub01.in

Memory limits can be enforced by

  ulimit -m 1048576
  ./main <pub01.in

These limiting commands should work on all Linuxes, not only inside the docker container.

courses/b4b33alg/upload_system.txt · Last modified: 2022/11/23 20:30 by berezovs