AtCodee

AtCoder社が開催するプログラミングコンテスト用の提出/テスト用コマンド.
ソースコードの提出,サンプルケースの取得,サンプルケースチェックが可能で,サンプルケースに通らない場合は提出できない.
単純にdiffがあるかどうかで判定しているので,誤差が生じる問題は現状テスト無しで提出するオプションをつけるしかない

リポジトリはこちら

使い方はシンプルで,とりあえずPATHを通すだけ.

クッキーの保存をバイナリが存在する場所に設定しているので,シンボリックリンクがオススメ

Usage

Submit                  : atcodee submit (abc|arc) revision id -f filepath -c run_command [-p test_dir]  
Submit w/o test  : atcodee submit (abc|arc) revision id -f filepath -c run_command --no-test  
Make tests           : atcodee test --generate (abc|arc) revision [-p test_dir]  
Run tests              : atcodee test --run (abc|arc) revision id -f filepath -c run_command [-p test_dir]

提出やテストに際に必要なのはURLのビルドも含めて,以下の通り:

  • コンテストの種類(e.g. abc, arc)
  • リビジョン(e.g. 1,01,001)
  • 問題番号(e.g. a)
  • ファイル(e.g. ./a.sh)
  • 実行コマンド(e.g. bash)

サンプルケースの取得だけはコンテストの種類とリビジョンのみで可能

自分の環境だと例えばbashは2つ存在して,普段使う方はバージョンが著しく異なるからAtCoderのBashと使えるsyntaxに差がある. そうすると結構テストでこけるので,別のbashを使いたい

which bash #=> /bin/bash (3.2.53)  
where bash #=> /bin/bash, /usr/local/bin/bash (4.3.33)

なので,AtCoder Beginner Contest001のA問題にa.shを提出する場合は,

atcodee submit abc 1 a -f a.sh -c /usr/local/bin/bash  

として提出する.

現在,実行環境の判断として-cで指定されたもののコマンド名(/usr/local/bin/bash => bash)を使うので,Cやruby19などとしているひとはサンプルケース取得にしか使えない悲しみ