Skip to content

aray-99/atcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AtCoder環境構築まとめ

インストール済みツール

✅ 完全に使用可能

  • Python 3.13.7 - コーディング用
  • g++ 11.4.0 - C++コンパイラ
  • uv 0.9.27 - Python パッケージマネージャー
  • Node.js v24.14.0 - JavaScript実行環境
  • atcoder-library (ACL) - データ構造・アルゴリズムライブラリ

⚠️ ログイン制限あり

  • atcoder-cli (acc) 2.2.0 - ログインが必要(CAPTCHA制限)
  • online-judge-tools (oj) 11.5.1 - 一部機能のみ使用可能

実用的なワークフロー

方法1: oj を部分的に使用(推奨)

# 1. ディレクトリ作成
mkdir -p abc123/a && cd abc123/a

# 2. テストケースダウンロード(ログイン不要で動作)
oj download https://atcoder.jp/contests/abc123/tasks/abc123_a

# 3. コードを書く
vim main.cpp  # または main.py

# 4. ローカルテスト
oj test -c "g++ -std=c++17 main.cpp && ./a.out"  # C++
oj test -c "python3 main.py"                      # Python

# 5. 提出はブラウザから手動で行う

方法2: 完全手動ワークフロー

# 1. ディレクトリ作成
mkdir -p abc123/a && cd abc123/a

# 2. ブラウザから問題を見て、サンプル入力をコピー
mkdir test
cat > test/sample-1.in
# サンプル入力をペースト、Ctrl+D

cat > test/sample-1.out
# サンプル出力をペースト、Ctrl+D

# 3. コードを書く
vim main.cpp

# 4. 手動テスト
./a.out < test/sample-1.in

# または一括テスト用スクリプト
for f in test/*.in; do
  echo "Testing $f"
  ./a.out < "$f" | diff - "${f%.in}.out"
done

# 5. ブラウザから提出

ACL (AtCoder Library) の使用方法

# C++でACLを使う場合
g++ -std=c++17 -I ~/atcoder/ac-library main.cpp

# コード内
#include <atcoder/all>
using namespace atcoder;

今後の選択肢

  1. 現状維持: oj でテストケースDL + ローカルテスト、ブラウザで提出
  2. CAPTCHA解決待ち: AtCoderの仕様変更を待つ
  3. 代替ツール: 他のツールやブラウザ拡張機能を探す
  4. 完全手動: テストケースも手動でコピー

便利なエイリアス

~/.bashrc に追加すると便利:

# C++コンパイル(ACL対応)
alias acg='g++ -std=c++17 -I ~/atcoder/ac-library'

# テスト実行
alias act='oj test -c'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors