Crates.io | ojcmp |
lib.rs | ojcmp |
version | 0.4.0 |
source | src |
created_at | 2020-05-05 15:28:44.981313 |
updated_at | 2021-05-06 02:55:56.116015 |
description | online judge comparer |
homepage | |
repository | https://github.com/ThinkSpiritLab/ojcmp |
max_upload_size | |
id | 237764 |
size | 62,206 |
online judge comparer
Maintaining 0.4.0
cargo install ojcmp
cargo build --release
Install by cargo
cargo install --path .
Install manually
cp target/release/ojcmp /usr/bin
ojcmp 0.4.0
Nugine <nugine@foxmail.com>
USAGE:
ojcmp <SUBCOMMAND>
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
ojcmp-normal 0.4.0
Normal compare
USAGE:
ojcmp normal [FLAGS] [OPTIONS] <--std <path>|--std-fd <fd>> <--user <path>|--user-fd <fd>>
FLAGS:
-h, --help Prints help information
-q, --quiet No output printed to stdout or stderr
-a, --read-all Reads all bytes of user file even if it's already WA
-V, --version Prints version information
OPTIONS:
-b, --buffer-size <bytes> Buffer size (in bytes) for both std and user file [default: 65536]
-s, --std <path> Std file path
--std-fd <fd> Std file descriptor
-u, --user <path> User file path
--user-fd <fd> User file descriptor
type | value |
---|---|
exit_code (AC) | 0 |
exit_code (WA) | 1 |
exit_code (PE) | 2 |
exit_code (error) | 101 |
stdout | "AC" / "WA" / "PE" |
stderr | error message |
trim_end(file)
judge!(AC, b"1\r\n\r\n\r\n", b"1 ");
for each line, trim_end(line)
judge!(AC, b"1 \n", b"1");
for each line, check spaces between non-space chars
judge!(PE, b"1 3\n", b"1 3\n");
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.
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.