# usaco run [[ $# -ge 1 ]] || usage dir="$(find_problem "$1")" build_problem "$dir" # run from inside the dir so freopen finds the .in file (cd "$dir" && ./main) # show the .out file if the program wrote one io="$(detect_io "$dir" || true)" if [[ -n "$io" && -f "$dir/$io.out" ]]; then echo "── $io.out ──" cat "$dir/$io.out" fi