Python 3.6+
pip install cython click
_sa.pxd/pyx
: cython binding ofsa.cpp/h
dp.py
: dp solver for special casesparse.py
: functions to read/write inputs and outputssolver.py
: where you should be writing your code to solve inputsprepare_submission
: generate submission.jsonrandom_choice
: brute-forceSA_solver.py
: where simulated annealing is usedsa.cpp/h
: cpp version of simulated anealingsetup.py
: cython setupsolver.py
: main entryTask.py
: contains a class that is useful for processing inputs
When writing inputs/outputs:
- Make sure you use the functions
write_input_file
andwrite_output_file
provided - Run the functions
read_input_file
andread_output_file
to validate your files before submitting! - These are the functions run by the autograder to validate submissions
Windows:
python setup.py build_ext --inplace
Linux:
make
python solver.py --help
# Usage: solver.py [OPTIONS] CASE
#
# CASE format are [s/m/l]+number, e.g. l1; all for solve all
#
# Options:
# -s, --solver [sapy|dp|sa]
# -e, --eval
# -f, --force-replace
# --help Show this message and exit.