UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeCompetitive ProgrammingOffline Judge

Related Tools

Code FormatterMatrix GeneratorComplexity CalcBit VisualizerBitmask PlannerPrime FactorsMEX CalcInterval MergerMatrix RotationPBDS GeneratorSegment TreeGraph VisualizerStress TesterModulo CalcConvex HullPath FinderBig-O Analyzer

Offline Judge & Test Case Runner

Run your JavaScript solution against unlimited custom test cases in a sandboxed Web Worker. Get AC/WA/TLE/RE verdicts and per-case run times.

You Might Also Like

All Competitive Programming

MEX Calc

Input a comma-separated array and see the MEX (Minimum Excluded) computed step-by-step with frequency table and visual walkthrough.

Graph Visualizer

Paste CP-style edge lists and watch a force-directed graph build itself. Drag nodes, toggle directed and 0/1-indexed, then copy the adjacency list.

Stress Tester

Paste your brute force, optimal solution and test generator to get a downloadable Python or Bash stress-test script that finds counter-examples.

Modulo Calc

Compute modular inverse, fast power modulo, and nCr mod p using BigInt precision. One-click C++ snippet output for each operation.

The slow part of a contest is not writing the solution, it is pasting input into a terminal 12 times. The Offline Judge Test Runner keeps every test case beside your code, executes all of them against a real time limit, and reports a verdict per case in the notation judges use: AC, WA, TLE and RE.

Code runs inside a Web Worker rather than on the page. That is what makes a genuine time limit possible: an infinite loop is terminated by killing the worker, where the same loop on the main thread would freeze the tab and take your test cases with it.

Two execution modes are offered. One expects a solve(input)function returning the answer, and the other gives you readLine() and print() for a stream-shaped solution. Nothing is compiled and nothing is uploaded; the language is JavaScript and it executes locally.

Running a Batch of Cases

  1. Write or paste your solution. In solve mode, a missing function is caught before anything runs, with No solve() found — define function solve(input) and return the answer.
  2. Fill in a case. Expected output is optional: leave it blank and the verdict becomes NO_EXPECTED, which just shows you what came out.
  3. Use the bulk importer for a set of cases at once. Separate cases with --- and split input from expected output with ===, which turns a problem statement's sample block into cases in one paste.
  4. Set the time limit, anywhere from 100 to 15,000 milliseconds with 2,000 as the default, then run everything. Verdicts stream in one at a time rather than appearing together.
  5. Read the stat row for passed, failed, cases run, total time and the slowest case, then take Copy Report for a summary to paste into notes or a message.

How It Calculates a Verdict

  • Comparison is not raw string equality. Trailing whitespace and a missing final newline do not fail a case, which matches how real judges behave and removes the most common false negative.
  • Numeric output is compared with a tolerance of 1e-6, so a floating-point answer differing in the last digits is accepted rather than marked wrong.
  • TLE means the worker was still running when the limit expired and was terminated. The detail line names the limit, and the case is not retried.
  • RE carries the thrown error message, so a typo surfaces as the actual exception rather than as a generic failure.
  • Up to 40 cases are held at once, and output previews are truncated at 4,000 characters so one runaway print cannot make the page unusable.
  • Each case runs in a fresh worker, so a global left behind by one case cannot leak into the next. That also means the timing includes worker startup, which is a millisecond or two of overhead on every measurement.
Solution — JavaScript · return from solve(input)

Runs in a sandboxed Web Worker — no network, no DOM, nothing leaves this tab. An infinite loop is killed at the time limit instead of freezing the page.

Test Cases (4/40)

Case 1
Not run yet.
Case 2
Not run yet.
Case 3
Not run yet.
Case 4
Not run yet.