How do I create a custom compare script for DOMjudge?
- User
How do I create a custom compare script for DOMjudge?
Assistant
Here are a few steps to create a custom compare script for DOMjudge:
-
Create a new file with a .cpp extension (e.g. custom_compare.cpp) in the DOMjudge judgehosts/compare directory. This will contain the code for your custom comparator.
-
Include the necessary header files like , etc.
-
Define a compare function that takes two std::istream references as parameters (for input streams to compare) and returns an int (0 for equal, 1 for different).
-
In the compare function, read input from the streams and compare them. You can read line-by-line, character-by-character etc. Return 0 if equal or 1 if different.
-
Print any error messages to std::cerr if needed.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.