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
submission_source
: the source code of the submissionjudge_input
: the judge’s inputpoint_value
: the point value of the test casecase_position
: the index of the test casebatch
: the batched the test case belongs tosubmission_language
: the language the submission was submitted inbinary_data
: a boolean, which isTrue
if the data was not normalized to Linux line endings, andFalse
otherwiseexecution_time
: the runtime of the program, in seconds
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:
check
can return either a CheckerResult
object (from dmoj.result import CheckerResult
), or a boolean (case_passed_bool
).
A CheckerResult
can be instantiated through CheckerResult(case_passed_bool, points_awarded, feedback='')
.
Sample Checker:
Here is the checker for the problem: Print 2 integers having sum equal to n (n is read from input).