Blog

Sharing insights about competitive programming, algorithms, and software development

Categories

Featured Posts

TutorialJanuary 15, 2026

How to Think About Dynamic Programming on Trees

A comprehensive guide to the thinking process for Tree DP in competitive programming: how to decide if a problem needs Tree DP, how to invent states and transitions, when rerooting is needed, and how to debug it effectively.

Dynamic ProgrammingTree DPAlgorithms
25 min readRead More →
TutorialJanuary 20, 2026

Suffix Array (SA) — Contest Black-Box Notes

Complete black-box guide to Suffix Arrays for competitive programming. Includes implementation, LCP array, pattern matching, distinct substrings, and common contest applications with ready-to-use code templates.

Suffix ArrayString AlgorithmsData Structures
30 min readRead More →
TutorialJanuary 25, 2026

Suffix Automaton (SAM) — Competitive Programming Note

Master Suffix Automaton: a compressed DFA of all substrings. Learn how to count distinct substrings, find occurrences, longest repeated substrings, and solve complex substring problems efficiently with practical recipes and examples.

Suffix AutomatonString AlgorithmsAutomata
20 min readRead More →

Recent Posts

Popular Tags

Dynamic ProgrammingTree DPAlgorithmsAdvancedCompetitive ProgrammingSuffix ArrayString AlgorithmsData StructuresCPSuffix Automaton

Stay Updated

Get notified when I publish new articles about competitive programming and algorithms.