https://github.com/encodeous/offlinejudge
Offline Judge for Fast-Slow Solution Validation
https://github.com/encodeous/offlinejudge
competitive-programming contest-programming judge
Last synced: 9 months ago
JSON representation
Offline Judge for Fast-Slow Solution Validation
- Host: GitHub
- URL: https://github.com/encodeous/offlinejudge
- Owner: encodeous
- Created: 2021-01-25T04:26:00.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-18T23:51:57.000Z (over 3 years ago)
- Last Synced: 2025-02-09T20:27:47.575Z (11 months ago)
- Topics: competitive-programming, contest-programming, judge
- Language: C#
- Homepage:
- Size: 52.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Offline Judge
Offline Judge is an advanced and configurable `fast/slow` grader that runs on your own computer!
This is a common technique used in contests to validate the accuracy of a solution.
## Quick Start
### Before Starting:
1. OJ requires `dotnet 5+` to be installed, install [dotnet](https://dotnet.microsoft.com/download) if it is not installed already!
2. Make sure you have a compiler that can run your desired solution
3. Download ([Github Releases](https://github.com/encodeous/offlinejudge/releases)) and set up Judge!
### Setting Up:
- Download Judge from the `Releases` section for your platform.
- **Windows Only (Optional)**: Run `judge.exe install` to install the application and add it to `PATH`
- Create a `judge.yaml`, an example is shown below.
- Modify the configuration to your heart's content.
- To run the judge, open a terminal and execute `judge run`. Make sure the current working directory contains a `judge.yaml`, or specify the path to `judge.yaml` with `judge run `
## Features
- Pre-judge commands - used for compilation, cleanup etc
- Independent resource limits for `[solution, reference, generator]`
- Parallel Judging - Allows for faster judging
- Short Circuit - Stops execution when a non-ac case is found
- Pretty printing - Nicely formatted judging results, similar to the format used on dmoj.ca
- Token/Exact grading - Able to switch between Exact grading and Tokenized Grading (separated by `\n` or space)
### Version Compatibility
Configuration files are **not** version compatible!
### Example Configuration
```yaml
#
# Offline Judge - Configuration File
# https://github.com/encodeous/offlinejudge
#
# Commands that are run once before judging any cases
pre-judge-commands:
- command: cmd
arguments: --arguments here
- command: cmd2
arguments: --arguments here
# Should the output be shown?
show-pre-judge-output: true
# Should the judge stop judging with it hits a non-ac case? (The test data may get buried by cases in the console!)
short-circuit: true
# Number of cases the judge runs
cases: 100
# The max number of parallel executions that occur at any given time
judge-threads: 3
# Should the judge use an exact grader or a space-separated token grader?
token-grader: false
solution:
# Working directory for the executing process, leave blank for current directory
working-directory:
# Filename or the full file path to the program
file-name: solution.exe
arguments: --arguments here
# Time limit in seconds
time-limit: 2.5
# Memory limit in MB
memory-limit: 512
reference:
working-directory:
file-name: reference.exe
arguments: --arguments here
time-limit: 2.5
memory-limit: 512
generator:
working-directory:
file-name: generator.exe
arguments: --arguments here
time-limit: 10
memory-limit: 1024
```
### Uninstalling (Windows)
- Run `judge uninstall` and make sure judge is not running.