import subprocess, os # regenerates solutions for all secret test cases without remaking the testcases # deletes all visualisations, re-run create-images.sh # for the sake of generating solutions, precision of solution we're using to solve # should be at least 1e-7 (or changed to <=1e-7 for the sake of generation) if __name__ == '__main__': for file in os.listdir('../data/secret'): file = "../data/secret/" + file if ".in" not in file: if ".png" in file: os.remove(file) continue with open(file) as f: test = f.read() answer = subprocess.run( ["py", "../submissions/accepted/am-polylabel.py"], input=test, text=True, capture_output=True) with open(file[:-3]+".ans", "w+", newline="\n") as f: f.write(answer.stdout)