Checker

The following documentation applies to the new comparators only. If you have created a problem on Drafts before the new comparators were implemented, you will have an option to switch to the new comparators.

Types

Type Description Options
String Treats each space separated token as strings. These tokens must match exactly. Strict Space
Int Parses each space separated token as intgers. Each integer must be in base 10 and fit in 64 bits (signed). Strict Space
Float Parses each space separated token as floating-point numbers. Each number must fit in 64 bits. Strict Space, Precision
Yes/No Compares yes's and no's in any letter casing. For example, "Yes", "yes", "YES", etc are equivalent. Strict Space
Custom Please refer to Custom Checker page.

Options

Option Description
Strict Space (On) Each space character must match exactly.
Strict Space (Off) All consecutive sequences of space are considered equivalent. For example, "\n \t" and " \t \n " are considered the same. Trailing spaces are ignored.
Transform CRs Transforms CRs ('\r') and CRLFs ("\r\n") to LFs ('\n'). Available with Strict Space (On).
Ignore Trailing LF One trailing LF ('\n', if any) is ignored. Available with Strict Space (On).
Precision Defines the value of eps in comparison1 of floating point numbers.

  1. Two floating point numbers, a and b, are compared using the following expression:

    abs(a-b) <= eps+1e-15 || (b+1e-15 >= min(a*(1-eps), a*(1+eps)) && b+1e-15 <= max(a*(1-eps), a*(1+eps)))

    [return]

  • Published March 21, 2021

Search