Skip to content

Instantly share code, notes, and snippets.

@j20232
Last active January 19, 2020 14:44
Show Gist options
  • Save j20232/a9671e5a019ad6b7e90bd15b8e14fede to your computer and use it in GitHub Desktop.
Save j20232/a9671e5a019ad6b7e90bd15b8e14fede to your computer and use it in GitHub Desktop.
Code-runner for AtCoder
#!/bin/sh
/usr/local/bin/g++-9 $1 -o a.out
contest=$(cut -d '_' -f 1 <<< $1)
index=$(cut -d '_' -f 2 <<< $1)
type=$(cut -d '.' -f 1 <<< $(cut -d '_' -f 3 <<< $1))
url="https://${contest}${index}.contest.atcoder.jp/tasks/${contest}${index}_${type}"
rm -rf test/*
oj dl $url
oj test
#!/bin/sh
/usr/bin/g++ $1 -o a.out
contest=$(echo $1 | cut -d '_' -f 1)
index=$(echo $1 | cut -d '_' -f 2)
type=$(echo $1 | cut -d '.' -f 1)
type=$(echo $type | cut -d '_' -f 3)
url="https://${contest}${index}.contest.atcoder.jp/tasks/${contest}${index}_${type}"
rm -rf test/*
oj dl $url
oj test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment