v1.1.0 · Free & open source

Test your AtCoder solution before you press Submit.

acrun downloads every sample of a contest, runs your code against all of them in one command, and shows exactly which one fails and why. When everything is AC, it copies your code and opens the submit page.

macOS, Linux and Windows · Other ways to install · MIT or Apache-2.0

  1. 1. acrun new abc387 — a folder per task, with every sample
  2. 2. acrun test — AC / WA / TLE for each sample, with the diff
  3. 3. acrun submit — code copied, submit page opened
1 commandto run every sample. No more copy-pasting inputs into the terminal.
Any languagePython, PyPy, C++ and Rust built in. Add any other with two lines of config.
No passwordacrun never logs in or posts for you. You press the Submit button yourself.
New in 1.1 · acrun problems

Pick your next problem without leaving the terminal

Every AtCoder problem in one list, with difficulty colors like AtCoder Problems and a ✓ on what you solved. Filter, let acrun choose, press Enter, and the folder is ready for acrun test.

  1. Run acrun problems
  2. Narrow it down: t ABC / ARC / AGC, d difficulty color, u unsolved only, / search
  3. Choose: move with ↑↓, or r for a random pick
  4. Press Enter: abc301/d/ with your solution file and the samples. o opens the page instead.

Your ✓ marks come from your AtCoder id: add atcoder_user = "your_id" to the config or pass --user. In scripts: acrun problems --random --diff 800-1199 --unsolved or --list --json.

The list comes from the AtCoder Problems API, cached for a day and fetched politely. Statements are never downloaded in bulk: only the problem you pick, one page, like acrun new.

When you'll use it

Four moments where acrun saves you

acrun is for anyone who solves AtCoder problems: weekly ABC regulars, people practising old contests, and Neovim users who never want to leave the editor.

Saturday, 21:00

The ABC just started and every second counts

Run one command as the contest opens. You get a/ to g/, each with a solution file from your template and all the samples. You start reading problem A instead of creating files.

acrun new abc432
Avoiding a penalty

Sample 1 passes, but sample 3 would have cost you 5 minutes

Checking only the first sample by hand is how WA penalties happen. acrun test runs all of them and prints the input, the expected output and yours for each one that fails, so you see the bug before AtCoder does.

acrun test
Practising past contests

Solving old problems on a train or a weekend

Past contests need no login. Fetch one task by its URL, solve it, and test it as many times as you like without touching AtCoder again. Testing runs entirely on your machine, so it even works offline.

acrun fetch https://atcoder.jp/contests/abc300/tasks/abc300_c
In Neovim

Never leave the editor

With the bundled plugin, <leader>at saves the file and shows the results in a split; <leader>as copies the code and opens the submit page. Fix, press two keys, repeat.

{ "hina-kura49/acrun", config = function() require("acrun").setup() end }
Features

Small, fast, and hard to break

acrun keeps the part that touches AtCoder as small as possible, so it keeps working when the site changes.

Every sample, every task

Give it a contest id (abc387) or any contest URL. Pick tasks with -o a,b. Old and new task pages, Japanese and English, are all understood.

Judged like AtCoder

Tokens must match; trailing spaces and the last newline do not matter. -e 1e-6 accepts answers within an error. You get AC, WA, RE or TLE per sample.

Time limits that make sense

The task's own time limit is read from the page. TLE is reported at twice that, because local interpreters are slower, and a slow AC is marked so you are warned.

Your language, your template

Python, PyPy, C++ and Rust work out of the box. Any other language is a file, an optional build and a run command. New files start from your template.

Submit without a password

acrun submit copies your code and opens the right submit page. You paste and press the button, so nothing breaks when AtCoder changes its form.

Running contests too

Tasks of a running contest need a login. Copy the REVEL_SESSION cookie from your browser once with acrun login; it is stored with permission 600.

Pick your next problem

acrun problems lists every problem with its difficulty color and your ✓. Filter by ABC / ARC / AGC, color and unsolved, press r for a random one and Enter to set it up.

Gentle on every site

The problem list is cached for a day and your submissions are fetched incrementally, a second apart. Pages from AtCoder are only read one task at a time, when you ask.

How it works

Three commands, from problem to submission

  1. acrun new

    Reads the task list and each task page once, waiting between requests. Writes tests/sample-N.in/.out, the time limit in .acrun.toml, and your solution file.

  2. acrun test

    Builds once if the language needs it, then feeds each sample to your program on stdin and compares the output. Nothing is sent anywhere.

  3. acrun submit

    Copies the solution to the clipboard and opens /submit?taskScreenName=… in your browser. You paste and submit.

Install

Install acrun

Pick one. The download links always point to the newest release.

Homebrew (macOS, Linux)

brew install hina-kura49/tap/acrun

Install script (macOS, Linux)

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hina-kura49/acrun/releases/latest/download/acrun-installer.sh | sh

PowerShell (Windows)

powershell -ExecutionPolicy Bypass -c "irm https://github.com/hina-kura49/acrun/releases/latest/download/acrun-installer.ps1 | iex"

Cargo

cargo install --locked --git https://github.com/hina-kura49/acrun

Then try it: acrun new abc387 && cd abc387/a, write main.py, and run acrun test.

PlatformFile
macOS Apple siliconacrun-aarch64-apple-darwin.tar.xz
macOS Intelacrun-x86_64-apple-darwin.tar.xz
Linux x86_64acrun-x86_64-unknown-linux-gnu.tar.xz
Linux arm64acrun-aarch64-unknown-linux-gnu.tar.xz
Windows x86_64acrun-x86_64-pc-windows-msvc.zip
ChecksumsSHA256SUMS

Downloaded the macOS file by hand?

The binary is not signed by Apple, so macOS may say it "cannot be verified". After unpacking, remove the download mark once and move it onto your PATH:

tar -xf acrun-aarch64-apple-darwin.tar.xz
xattr -d com.apple.quarantine acrun-aarch64-apple-darwin/acrun
sudo mv acrun-aarch64-apple-darwin/acrun /usr/local/bin/

Homebrew and the install script do not need this.

FAQ

Questions

Is it allowed to use acrun in rated contests?

Fetching samples and testing locally is what many contestants already do by hand, and acrun never submits for you. Still, check AtCoder's current rules (especially on automation and generative AI) before any rated contest; they are the final word.

Why doesn't it submit automatically?

Automatic submission needs your password, breaks whenever AtCoder changes its form, and the login page has a CAPTCHA. Pasting and pressing the button takes two seconds and never breaks.

How is it different from online-judge-tools or atcoder-cli?

Those tools have not been updated for years and break on recent AtCoder changes (the login CAPTCHA, MiB limits, new language names). acrun does less on purpose: read pages, test locally, open the submit page.

Do I need to log in?

Not for past contests. For a contest that is running right now, copy the REVEL_SESSION cookie from your browser and run acrun login once. acrun logout removes it.

Which languages work?

Python, PyPy, C++ and Rust are built in. Run acrun init and add any language to ~/.config/acrun/config.toml with a file, an optional build and a run command.

Does it put load on AtCoder?

No more than opening the pages yourself. It only fetches when you run new or fetch, and waits between requests. Testing never contacts AtCoder.

Where do the difficulties in acrun problems come from?

From AtCoder Problems by kenkoooo, through its public API. acrun caches the list for a day (--refresh to update now), waits between requests and only asks for your new submissions. Without a network it shows the cached list. Problem statements are not downloaded in bulk.

Is it free?

Yes. acrun is open source under MIT or Apache-2.0, at your option. It is an independent project, not affiliated with AtCoder.