Template script for coding contest designed to be reused for each different level.
-
Install the required packages by running
pip install -r requirements.txt
-
Modify the variables
INPUT_FILE_PATTERN
andOUTPUT_FILE_PATTERN
to match your desired input and output file patterns. -
Implement your logic to solve the level in
do_work
. -
Save the modified code as
main.py
. -
Put the files that have to be processed in the directory specified by the
INPUT_FILE_PATTERN
variable. -
Run the script
python main.py
The following variables can be modified to configure the script:
INPUT_FILE_PATTERN
: This variable sets the filename pattern for the input files. By default, it is set to'input/*.in'
, which matches all files with the.in
extension in theinput/
directory. You can modify this variable to match a different filename pattern or directory structure.OUTPUT_FILE_PATTERN
: This variable sets the filename pattern for the output files. By default, it is set to'output/*.out'
, which creates output files with the.out
extension in theoutput/
directory. You can modify this variable to change the filename pattern or output directory.
The following parts MUST be configured:
do_work
: This function processes the input and returns the result. You have tomodify this function to implement your own processing logic.