⚡ CP ArenaA competitive programming judge for VS Code. Compile, run, and test your solutions against multiple test cases without leaving your editor. ✨ Features
🚀 Getting StartedInstallOpen Extensions in VS Code, search for CP Arena, and click Install. Requirements
🔧 Set up your compilerCP Arena ships with generic defaults, but compiler names and flags vary between machines and operating systems. Edit the command for your language to match your own setup before running anything. Open Settings → Extensions → CP Arena, or add the setting directly to your C++The default is
Anything valid on your command line works here — add sanitizers, change the standard, point at an absolute compiler path, whatever you need. CP Arena appends the source file and output path automatically, so don't include them yourself. Other languages
Verifying your compilerIf a run fails with a "command not found" style error, the command isn't on your
Whatever name works there is the name to put in your settings. 📖 UsageImport a problemInstall Competitive Companion, open a problem page, and click the extension's + icon. CP Arena creates the source file, saves the sample tests, and opens everything in the sidebar. Open a problem locallyOpen any supported source file ( RunClick ▶ Run All in the sidebar, or use the Run Tests button in the status bar. Your file is saved and compiled first, then each case runs in turn. Cards collapse on To re-run a single case, click the ▶ on that card. SubmitClick the Submit icon. CP Arena saves the file, copies your code to the clipboard, and opens the matching Codeforces submit page (contest, gym, group, and problemset URLs are all handled). Paste and submit. If the problem has no saved URL, you'll be prompted for one.
|
| Setting | Default | Description |
|---|---|---|
cp-arena.general.defaultLanguage |
cpp |
Language used for newly imported problems |
cp-arena.general.timeLimit |
3000 |
Time limit recorded on locally created problems (ms) |
cp-arena.general.companionPort |
10043 |
Port the Competitive Companion listener binds to |
cp-arena.general.savePath |
(workspace root) | Where imported problem files are written |
cp-arena.cpp.compileCommand |
g++ -O2 -std=c++17 |
C++ compile command |
cp-arena.c.compileCommand |
gcc -std=c17 -O2 -Wall |
C compile command |
cp-arena.java.compileCommand |
javac |
Java compile command |
cp-arena.java.runCommand |
java |
Java run command |
cp-arena.rust.compileCommand |
rustc -O |
Rust compile command |
cp-arena.python.runCommand |
python3 |
Python interpreter |
The sidebar shows the problem's original time limit, but runs are enforced against 2.5× that limit. Local hardware, cold binary starts and editor overhead rarely match the original grading server, so enforcing the exact limit tends to produce false
TLEs.
🛠 Supported Languages
| Language | Mode | Default tool |
|---|---|---|
| C++ | compiled | g++ |
| C | compiled | gcc |
| Rust | compiled | rustc |
| Java | compiled, then run | javac + java |
| Python | interpreted | python3 |
| JavaScript | interpreted | node |
| Go | compiled and run | go run |
📋 Commands
Available from the command palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command | Description |
|---|---|
CP Arena: Run All Test Cases |
Compile and run every test case |
CP Arena: Add Test Case |
Append an empty test case |
CP Arena: Stop Execution |
Kill the running solution |
CP Arena: Clear All Test Cases |
Remove all test cases from the current problem |
CP Arena: Submit Code |
Copy code and open the submit page |
🧠 How Verdicts Work
- AC — output matches
- WA — tokens differ. Trailing whitespace and newlines are ignored, and
YES/NOcompare case-insensitively - TLE — exceeded 2.5× the problem's time limit, or produced more than 16 MB of output
- RTE — non-zero exit code or a fatal signal such as
SIGSEGV - CE — compilation failed; the compiler's output is shown in the sidebar
🏗 Building from Source
git clone https://github.com/AashwatJain/cp-arena.git
cd cp-arena
npm install
npm run build # bundles src/ into dist/ with esbuild
npx vsce package # produces a .vsix
Press F5 in the project to launch a VS Code window with the extension loaded for debugging.
📜 License
See LICENSE.md.
Made for competitive programmers