// the find
EndlessCheng/codeforces-go
算法竞赛模板库 by 灵茶山艾府 💭💡🎈
A personal template library for competitive programming in Go, maintained by a well-known Codeforces competitor (0x3F). It covers nearly every algorithm and data structure you'd need for CP/ACM-ICPC/LeetCode (segment trees, SAM, FFT/NTT, flow, tree algorithms, etc.), plus thousands of solved LeetCode problems organized by contest. It's for competitive programmers who happen to use Go, not for people looking for a Go algorithms package.
The breadth is genuinely rare for Go specifically - most CP template libraries are C++, so having idiomatic Go implementations of link-cut trees, persistent segment trees, Pollard-Rho, and Mobius inversion is unusual. The testing pattern (splitting main into run(io.Reader, io.Writer) so you can diff against a brute-force 'runAC' with randomized inputs) is a legitimately good practice worth stealing even outside CP. The LeetCode archive is enormous and consistently structured (one folder per contest problem, each with its own test file), making it useful as a training corpus.
Everything - README, code comments, variable names in places - is in Chinese with zero English docs, which will stop most non-Chinese-speaking Go developers cold despite Go being an English-first ecosystem. The directory is literally named 'copypasta': this is explicitly meant to be copy-pasted into a contest submission, not imported as a module, so there's no package boundary, no semver, no API you can depend on. It's organized around problem IDs and contest numbers rather than general-purpose use cases, so finding the right template means already knowing what you're looking for. None of this is wired together as a library you'd `go get` and call - it's a reference you raid, not a dependency.