ojcmp

Crates.io MIT licensed CI

online judge comparer

Status

Maintaining 0.3.2

Install

bash cargo install ojcmp

Build

bash cargo build --release

Install by cargo

bash cargo install --path .

Install manually

bash cp target/release/ojcmp /usr/bin

Usage

``` ojcmp 0.3.2 Nugine nugine@foxmail.com

USAGE: ojcmp

FLAGS: -h, --help Prints help information -V, --version Prints version information

SUBCOMMANDS: float Float compare help Prints this message or the help of the given subcommand(s) normal Normal compare strict Strict compare ```

Return Value

| type | value | | ------ | ------------------ | | code | errno | | stdout | "AC" / "WA" / "PE" | | stderr | error message |

Current Implementation

Mode: Normal

trim_end(file)

rust judge!(AC, b"1\r\n\r\n\r\n", b"1 ");

for each line, trim_end(line)

rust judge!(AC, b"1 \n", b"1");

for each line, check spaces between non-space chars

rust judge!(PE, b"1 3\n", b"1 3\n");

Mode: Strict

User file must have the same bytes with std file.

The two byte streams must be exactly the same.

There is no "PE" in this mode.

Mode: Float

Compare two streams of float numbers which are splitted by ascii whitespaces.

Parse any float number as f64 (aka double in C language).

Ascii whitespaces between two float numbers are considered as a single separator symbol.

Use CLI option --eps to specify eps value, for example --eps 1e-3.

There is no "PE" in this mode.

Change Log