Repolode
EndlessCheng

EndlessCheng/codeforces-go

A Go template library of competitive programming algorithms and data structures, with solutions to Codeforces and LeetCode problems.

Stars
8,785
Forks
829
Open issues
2
Last commit
14 days ago

What is it?

This repository is a categorized collection of reusable Go templates for competitive programming. It covers data structures such as segment trees, Fenwick trees, union-find, tries, suffix automata and link-cut trees, along with algorithms for strings, number theory, combinatorics, FFT/NTT, computational geometry, dynamic programming and graph theory.

Beyond the templates, it includes a directory of problem sets organized by topic, along with Go solutions to Codeforces problems stored in a main directory. Each solution follows a shared pattern: a run function taking io.Reader and io.Writer, which makes it easy to write tests and stress-test against a brute-force implementation.

The project is aimed at developers who practice algorithm problems in Go and want a reference for common templates and the problem sets used to train them.

Key features

  • 01Templates for segment trees, Fenwick trees, union-find, tries and other data structures
  • 02Coverage of string algorithms such as KMP, suffix automata and AC automaton
  • 03Number theory, combinatorics, FFT/NTT and computational geometry templates
  • 04Dynamic programming and graph theory templates, including max flow and LCA
  • 05Go solutions to Codeforces problems with a testable run-function structure

Use cases

  • Practicing competitive programming problems in Go
  • Looking up a ready-made template for a specific data structure or algorithm
  • Following a topic-based problem set to train on LeetCode or Codeforces

Topics

FAQ

What is codeforces-go?
A Go template library of competitive programming algorithms and data structures, with solutions to Codeforces and LeetCode problems. This repository is a categorized collection of reusable Go templates for competitive programming. It covers data structures such as segment trees, Fenwick trees, union-find, tries, suffix automata and link-cut trees, along with algorithms for strings, number theory, combinatorics, FFT/NTT, computational geometry, dynamic programming and graph theory.
Is codeforces-go free to use? What license does it have?
codeforces-go is open source under the MIT license. Check the license terms before using it in commercial products.
Is codeforces-go still maintained?
Actively maintained. The last commit to codeforces-go was on Oct 8, 2026.
What can I use codeforces-go for?
Practicing competitive programming problems in Go Looking up a ready-made template for a specific data structure or algorithm Following a topic-based problem set to train on LeetCode or Codeforces
Where can I get codeforces-go?
The source code and installation instructions are on GitHub: https://github.com/EndlessCheng/codeforces-go

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects