Languages and limits

The five languages you can solve in, the time and memory your code gets, why Java starts with less of the budget, and the one thing TypeScript does differently.

View as .md

Five languages: Java, C++, Python, JavaScript and TypeScript. Which of them a given problem offers is up to its author - the picker lists only the ones with a working stub and a verified reference solution.

Time#

A whole submission gets five seconds, and that is a hard ceiling on the sandbox rather than a per-problem setting anyone can raise. Every test case in the submission runs inside that one budget, in a single process - which is why a problem with forty cases is not forty times slower to judge than one with two.

Compilation is timed separately and more generously.

Memory#

Each language gets its own ceiling, sized to what it actually needs: Java and TypeScript get the most, C++ and Python less, because they need less to do the same work.

This is also why "beats X% on memory" is never compared across languages. Java reports around 48 MB where C++ reports 7 MB for identical work, so a cross-language ranking would tell every Java user they are in the bottom decile forever for writing correct code.

Size#

  • Your source is capped at 64 KB. No solution to a practice problem approaches this.
  • Output is capped, per attempt. A program that prints inside a hot loop gets cut off, and a very loud one is stopped with Too much output.
  • Custom input you type into the Testcase pane is capped too, well above any hand-typed value.

Deep recursion works#

A recursive depth-first search over a large tree is ordinary, correct code, and on default settings it overflows the stack in both Java and C++. Both get a large stack here specifically so that it does not - hundreds of thousands of frames are fine.

If you hit Runtime error with a stack overflow, treat it as a real depth problem rather than a sandbox limit you cannot do anything about.

Per-language notes#

Your file is Solution.java. The code that calls it is a separate file, so compiler errors report lines in your editor and nothing else.

The JVM startup cost described above is the only thing to keep in mind. Prefer StringBuilder over repeated string concatenation in a loop, as you would anywhere.

What the sandbox does not have#

No network. Your solution cannot make an HTTP request, read a URL or reach anything outside its own process. Everything a problem needs is in its arguments.

No filesystem to speak of, and nothing persists. Each attempt starts clean.

Was this page helpful?

Last checked against the product on . Behaviour changes are listed in the changelog.