{% extends "base.html" %} {% block body %} custom

Original Document

A checker Python script must implement a function that is called by the judge:

def check(process_output, judge_output, **kwargs):
    # return True/False

Variables in global scope will exist throughout the grading process.

**kwargs is a directory containing

Additionally, if the check method has the flag run_on_error set, it will be run against the submission’s output, even if it receives an IR/TLE/RTE/MLE verdict. The only built-in checker that has this flag set is the linecount checker.

Return:

True for correct output, False for incorrect one

Sample Checker:

Here is the checker for the problem: Print 2 integers having sum equal to n (n is read from input).

def check(process_output, judge_output, judge_input, **kwargs):
    # process the input
    input_arr = judge_input.split()
    assert(len(input_arr) == 1)
    n = int(input_arr[0])

    #  process the contestant's output
    output_arr = process_output.split()

    if (len(output_arr) != 2):
        return False

    try:
        a, b = int(output_arr[0]), int(output_arr[1])
    except:
        return False

    if (n == a + b):
        return True
    return False
{% endblock body %}