algo
Write 10 lines, get 100 lines of clean C++17
Why algo
Section titled “Why algo”You know the problem. You know the algorithm. But you’re spending 20 minutes on priority_queue<pair<ll,int>, vector<pair<ll,int>>, greater<>> and for (int i = 0; i < n; i++) cin >> a[i].
algo handles the boilerplate so you can focus on the algorithm.
Get started Install, compile, run.
Language tour Learn algo through worked examples.
Guides I/O, collections, graphs, DP, and C++ interop.
Reference Syntax, types, builtins, and stdlib.
What it looks like
Section titled “What it looks like”input: n: int a: [int][n]sort(a)println lower(a, 5)Compiles to:
#include <bits/stdc++.h>using namespace std;typedef long long ll;int main() { cin.tie(nullptr)->sync_with_stdio(false); int n; cin >> n; vector<int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; sort(a.begin(), a.end()); cout << (int)(lower_bound(a.begin(), a.end(), 5) - a.begin()); cout << "\n"; return 0;}What you get
Section titled “What you get”Built-in algorithms - dijkstra, BFS, segment trees, DSU, LCA, bipartite matching, and more. Call them as functions, get the struct emitted only with the methods you use.
g = wgraph(n, undirected=true)d = g.dijkstra(0).distDP blocks - declare dimensions, base cases, and transitions. The compiler handles the loops and initialization.
dp[i: 0..n, w: 0..W] -> int, maximize: base: dp[0][w] = 0 <- dp[i-1][w] guard w >= weights[i] <- dp[i-1][w - weights[i]] + values[i]Pattern matching - destructure structs and tuples with guards.
match node: case Node((a, b), w) where a + b == w: answer = a * b default: answer = a + b + wClean output - no hidden runtime, no template boilerplate. The generated C++ is readable, debuggable, and submittable.