GithubHelp home page GithubHelp logo

ojcmp's Introduction

ojcmp

Crates.io MIT licensed CI

online judge comparer

Status

Maintaining 0.3.1

Install

cargo install ojcmp

Build

cargo build --release

Install by cargo

cargo install --path .

Install manually

cp target/release/ojcmp /usr/bin

Usage

ojcmp 0.3.1
Nugine <[email protected]>

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

Return Value

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

Current Implementation

Mode: Normal

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");

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

  • v0.3.1 Fix performance regression since v0.2.0. Allow unsafe code.
  • v0.3.0 Forbid unsafe code. Use subcommands for different modes.
  • v0.2.2 Fix bug in nan handling. (yank v0.2.1)
  • v0.2.1 Add spj_float mode. (yanked)
  • v0.2.0 Add strict mode. No break changes.
  • v0.1.3 No functional changes
  • v0.1.2 Fix algorithm bug
  • v0.1.1 Use unsafe static buffer

ojcmp's People

Contributors

nugine avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.