Everything related to algorithm contests (competitive programming).
Tested under WSL/Ubuntu
with g++
.
Install Ubuntu 20.04.5 LTS
under WSL2
, or natively - or a compatible
environment.
Optional: install Homebrew for a good binary package manager (brew
).
sudo apt install g++
Best to install node
version 16
using nvm
.
After installing node
, check pnpm
documentation for recommended installation
methods - possibly npm i -g pnpm
.
sudo apt install nlohmann-json3-dev
Use Ctrl + `.
pnpm install
This will also pre-compile bits/stdc++.h
headers into .pch
folder, for both
debug and release configurations.
Code (hence c
) the solution for task/problem a
:
c a
This opens or creates task/a/a.cpp
file from template.
Open another integrated terminal using Ctrl + Shift + 5.
Start the watch mode and keep it visible to see live compilation errors.
w
This is the same as w a
- the CLI uses last program by default.
Run the program (go; hence g
):
g
Or:
aa
There are Bash aliases for tasks
a
(aa
),b
(bb
), ...
If you're using watch mode, it should automatically run your tests.
Put *.in
and *.out
files inside task/a/test/
. Use any nested directory
structure.
Manually run tests:
t
Copy the solution to clipboard (s
for submit):
s
Paste into your online judge system.
Most commands allow omitting the program argument. Last program that you worked on will be used by default.
The CLI state is saved to .state.json
.