Programming Environment

Students will be provided with a programming environment described below. It is very similar to the one used at 2018 ICPC World Finals. The programming environment will be distributed on a bootable USB flash drive. The flash drive must be returned to the instructor at the completion of the course (or at withdrawal from the course).

Files

The student's home directory in the provided environment will be reset to the initial state at each login. All files and customization will be deleted at each login. The student's source code uploaded to the judging server during the weekly mini-contests and exams will become available for download from the server at the completion of the contest and will be downloadable for one week. The files will become permanently unavailable starting at noon on Friday the following week.

Software

The software configuration for the course will consist of the following:

  • Operating System:

    • Ubuntu 16.04.5 LTS Linux (64-bit)

  • Desktop:

    • GNOME

  • Editors:

    • vi/vim

    • gvim

    • emacs

    • gedit

    • geany

    • kate

  • Languages:

    • Java

      • OpenJDK version 1.8.0_181

      • OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)

      • OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

    • C

      • gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

    • C++

      • g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609

    • Neither Python, nor Kotlin will be supported in this course (although they were supported at the 2018 ICPC World Finals)

  • IDEs:

    • Eclipse 4.7 (Oxygen), configured with:

      • Java (OpenJDK version 1.8.0_181)

      • C/C++ (CDT 9.3.0 with Ubuntu 5.4.0-6ubuntu1~16.04.10 5.4.0 20160609)

    • IntelliJ (IDEA Community Edition 2017.2.3), configured with:

      • Java (version 1.8.0_181)

    • CLion (version 2017.2.2), configured with

      • C/C++ (version 5.4.0 )

    • Code::Blocks (version 13.12+dfsg-4), configured with

      • Java (OpenJDK version 1.8.0_181)

      • C/C++ (CDT 9.3.0 with Ubuntu 5.4.0-6ubuntu1~16.04.10 5.4.0 20160609)

Compilation of Submissions

During the contest, students will submit proposed solutions to the contest problems to the Judges using the DOMJudge contest control system. Source files submitted to the Judges will be compiled using the following command line arguments for the respective language:

  • C:

  gcc -g -O2 -std=gnu11 -static ${files} -lm
  • C++:

  g++ -g -O2 -std=gnu++14 -static ${files}
  • Java:

  javac -encoding UTF-8 -sourcepath . -d . ${files}

The “${files}” in the above commands represents the list of source files from the submission which will actually be compiled. Files with the following suffixes (and only files with these suffixes) will be submitted to the compiler:

  • For C submissions: files ending with .c

  • For C++ submissions: files ending with .cpp, .cc, .c++, or .cxx

  • For Java submissions: files ending with .java

Execution of Submissions

For each language, if the above compilation step is successful then the submission will be executed as follows:

  • For C/C++: the executable file generated by the compiler will be executed to generate the output of the submission.

  • For Java: the compiled main class will be executed using the following command:

    java -Dfile.encoding=UTF-8 -XX:+UseSerialGC -Xss64m -Xms1920m -Xmx1920m

Execution as described above will take place in a “sandbox”. The sandbox will allocate 2GB of memory; the entire program, including its runtime environment, must execute within this memory limit. For Java the runtime environment includes the JVM interpreter.

The sandbox memory allocation size will be the same for all languages and all contest problems. For Java, the above command shows the stack size and heap size settings which will be used when the program is run in the sandbox. For C and C++, the heap and stack sizes are limited only by the total amount of memory available in the sandbox.

Reference Materials

The following packages will be available on lab machines:

  • JDK JavaDocs

  • C++ STL docs