Skip to content

Instantly share code, notes, and snippets.

@bjin
Created May 20, 2011 14:03
Show Gist options
  • Save bjin/982944 to your computer and use it in GitHub Desktop.
Save bjin/982944 to your computer and use it in GitHub Desktop.
Code Jam runner
export DOWNLOAD_PATH=$HOME/Desktop
gcj () {
[ -e $DOWNLOAD_PATH/*.in ] || return
file=`ls $DOWNLOAD_PATH/*.in | head -n1`
echo "Filename $file"
problem=`basename $file | sed 's/^\([A-Z]\)-.*\.in/\1/g'`
testcase=`basename $file | sed 's/^\(.*\)\.in/\1/g'`
echo "Problem $problem"
read -p $'Is these information okay? (y/n)\n' -n 1
[ "$REPLY" == "y" ] || return
echo
mv "$file" .
echo "./$problem < $testcase.in | tee $testcase.out"
time ./$problem < $testcase.in | tee $testcase.out
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment