The 3rd Universal Cup Semifinals TechNotes
Last update: Aug 15, 2025
Issued by the Technical Committee (TC)
This document contains important technical information related to the Universal Cup Finals programming environment. It is important that your team read and understand all the information below.
Programs
- The languages allowed in the contest are C, C++, D, Go, Haskell, Java, Kotlin, Pascal, Python 3 and Rust.
- There is a limit of 200 kibibytes on the length of file submitted for judging.
- Your program must read its input from "standard input".
- Your program should send its output to "standard output". Your program may also send output to "standard error", but only output sent to "standard output" will be considered during judging. (Note that sending too much output to "standard error" might be harmful, in the sense that it can slow your program down.)
- If your program exits with a non-zero exit code, it will be judged as a RE with the verdict
Dangerous Syscalls. This can have a lot of different causes like division by zero, incorrectly addressing memory (e.g. by indexing arrays out of bounds), trying to use more memory than the limit, reading or writing to files, etc. - Programs submitted to the judges will be run inside a "sandbox".
- The sandbox will allocate memory for your program as specified in each problem.
- Your entire program, including its runtime environment, must execute within the specified memory limit for the problem. For interpreted languages (Java, Kotlin and Python), the "runtime environment" includes the interpreter (that is, the JVM for Java and Kotlin and the Python interpreter for Python).
- The sandbox memory allocation limit will be the same for every language.
- The command and command-line arguments used to invoke your program within the sandbox are the same as those given below.
- Programs running in the sandbox will be "pinned" to a single CPU core.
Compilers
C++ (C++98, C++11, C++14, C++17, C++20, C++23, C++26)
All C++ submissions are compiled using GCC 14.2.0. The detailed compilation tag is as follows:
g++ -o answer -x c++ answer.code -lm -O2 -DONLINE_JUDGE -std=c++XX
The -std=c++XX flag will be set according to your chosen standard (98, 11, 14, 17, 20, or 23).
C (C99, C11)
All C submissions are compiled using GCC 14.2.0. The detailed compilation tag is as follows:
gcc -o answer -x c answer.code -lm -O2 -DONLINE_JUDGE -std=cXX
The -std=cXX flag will be set to either c99 or c11 based on your selection.
Java (Java 8, Java 11, Java 17, Java 21)
We use Open JDK for all Java submissions.
- Java 8:
openjdk version "1.8.0_462" - Java 11:
openjdk 11.0.28 - Java 17:
openjdk 17.0.16 - Java 21:
openjdk 21.0.8
Flags -Xmx2048m, -Xss1024m, and -XX:ActiveProcessorCount=1 will be added when running Java programs.
Python (Python 3)
The Python Interpreter we used is Python 3.13.7.
Rust
The Rust compiler we used is rustc 1.89.0 (29483883e 2025-08-04). The detailed compilation tag is as follows:
rustc -o answer -C opt-level=3 --edition=2021 answer.code
D
The D compiler we used is DMD64 D Compiler v2.109.1. The detailed compilation tag is as follows:
dmd answer -O -release -inline -boundscheck=off
Pascal
The Pascal compiler we used is fpc, Free Pascal Compiler version 3.2.2. The detailed compilation tag is as follows:
fpc answer.code -O2
Haskell
The Haskell compiler we used is ghc, The Glorious Glasgow Haskell Compilation System, version 9.4.7. The detailed compilation tag is as follows:
ghc -O2 -rtsopts -XSafe -no-keep-hi-files -no-keep-o-files -static -o answer answer.hs
Kotlin
The Kotlin compiler we used is kotlinc-jvm 2.1.0 (JRE 21.0.5+11-Ubuntu-1ubuntu124.04). The JVM option we used to run Kotlin programs is the same as we used in Java programs.
Go
The Go compiler we used is go version go1.22.2 linux/amd64.
go build -o answer -ldflags -s -w -trimpath