JUDGE ENVIRONMENT
Judge environment
Where your code is compiled and run: language versions, the compile and run commands, how time and memory are measured, how deep recursion can go, and how each submission mode reads and writes data. The last section compares the settings that common OA platforms publish.
Languages, versions and commands
| Language | Version | Compile | Run |
|---|---|---|---|
| C++ | g++ (Debian 14.2.0-19) 14.2.0 | g++ -std=c++20 -O2 -pipe main.cpp -o main | ./main |
| Java | openjdk version "21.0.12.1" 2026-08-18 | javac -encoding UTF-8 Main.java | java -Xmx<60% of the memory limit> -Xss64m -XX:ReservedCodeCacheSize=32m -XX:MaxMetaspaceSize=64m -XX:ActiveProcessorCount=1 -cp main.jar Main |
| Python 3 | Python 3.13.5 | py_compile (syntax check only) | python3 -I main.py |
| Go | go version go1.24.4 linux/arm64 | go build -trimpath -o main main.go | ./main |
- The version column is what the judge last reported; before it has reported, the image’s major versions show.
- C++: #include <bits/stdc++.h> works and is precompiled, so it compiles faster; threads need no -pthread. AddressSanitizer is off, so an out-of-bounds access may not fail on the spot.
- Java: the public class must be named Main; inner classes work as usual.
- Python: besides the standard library, numpy and pandas (with their dependencies) are installed, but not sortedcontainers; use bisect or write your own ordered structure.
- Go: standard library only; modules cannot be downloaded.
- There is no network access while your code runs.
Time and memory
- The time limit is CPU time per test case, shown above the statement. All four languages share one limit, with no per-language multiplier; a few problems set their own limit for one language (pandas problems, for example), and the statement shows the one for the language you picked.
- Wall-clock time is capped at 3 times the CPU limit, at least 3 seconds, so a program stuck waiting for input or sleeping also times out.
- Memory counts what the process actually uses, 256 MB on most problems. Java’s heap is capped at 60% of the limit, leaving the rest to the JVM itself.
- At most 64 processes and threads in total; up to 64 KB of stderr is kept. Compiling may use up to 30 seconds of CPU time and 1 GB of memory.
Recursion depth and stack
- C++ and Go binaries run on the default system stack, which we do not raise (usually 8 MB on Linux). C++ recursion 10⁵ levels deep is already tight and can overflow into a runtime error when each level holds many locals; past 10⁵, go iterative and keep big arrays global. Go grows goroutine stacks on its own, so this limit rarely applies, but the stack counts toward memory.
- Java: a 64 MB thread stack (-Xss64m, as on Codeforces); tree recursion 10⁵ levels deep runs fine.
- Python (ACM mode): your code runs as written with the default limit of 1000 levels, so deep recursion needs sys.setrecursionlimit(10**6) first. Even then, recursion that passes through C-implemented calls (@cache, lru_cache, max(f(x) for …), map, a sorted key function) stops at roughly 3,000 to 5,000 levels with RecursionError; switch to a loop or memoize with a dict.
- Python (LeetCode mode): the recursion limit is already 10⁶ and the common modules are imported for you; @cache, lru_cache and min/max/sum/any/all are swapped for versions without the limit above, so 10⁵ levels pass. Other C calls such as map or a sorted callback still stop near 5,000.
Input and output in each mode
ACM mode
- Write a whole program that reads stdin and writes stdout. Templates for the common input shapes are in ACM I/O templates.
- Most problems split the output on whitespace and compare word by word, so trailing spaces and extra blank lines do not matter; a few compare exactly, treating \r\n as \n; problems with several right answers use their own checker.
- Whatever goes to stderr is not judged.
- Past about 10⁵ lines or numbers of input, how you read and write can decide a time limit: in Python use sys.stdin.readline or read it all with sys.stdin.read().split(); in C++ start with ios::sync_with_stdio(false); cin.tie(nullptr); and print '\n' rather than endl; in Java use BufferedReader instead of Scanner; in Go wrap stdin and stdout in bufio.
LeetCode mode
- Write only the Solution class (or the class a design problem asks for); the judge reads the input, calls it and prints the result.
- Custom input is one JSON value per line in parameter order, with trees and linked lists in the original array form. For a design problem, line 1 is the array of operation names and line 2 the array of their arguments.
- Anything you print shows up under Stderr for debugging and does not affect the verdict.
Hidden test cases
- In practice, a submission runs every test case and stops at the first failure, showing its input, expected output and your output (cut short when long).
- In a mock OA, a hidden case shows only its verdict, time and memory, as in a real OA: finding the counterexample is up to you.
- During a contest or skill exam, the server returns only the verdict of a hidden case, never its input or output.
Compared with other platforms
Only what each platform’s public documentation states, checked in October 2026; it may have changed since. “—” means we found nothing in its public docs. In a real OA, the task’s own statement wins.
| Setting | CSWork | HackerRank | CodeSignal | LeetCode |
|---|---|---|---|---|
| Time limit | One CPU limit per problem, the same for all four languages | Fixed per language: C++ 2 s, Java 4 s, Python 3 10 s, Go 4 s | Can be set per task and per language; the docs list no defaults | — |
| Memory limit | Set per problem, mostly 256 MB | C++, Python 3: 512 MB; Java 21, Go: 2048 MB | — | — |
| C++ | g++ 14, C++20, -O2 | g++ 8.3 (C++11, C++14, C++20); g++ 14.2 (C++23) | — | clang, C++23, -O2 |
| Python packages | numpy, pandas | The standard list has requests and similar; the ML one adds numpy and pandas; neither lists sortedcontainers | — | — |
Sources: HackerRank Execution Environment; CodeSignal API: task time limits; LeetCode: environments for the programming languages.
Scoring, resubmission, editor and proctoring rules per platform are on the interview platform rules page.