Word Chain Problem from NOIP2000 Advanced Group
The word chain problem involves constructing the longest possilbe sequence ("dragon") from a given set of words, starting with a specified character. Each word may be used at most twice in the chain. When two words are joined, overlapping parts are merged into one—e.g., beast and astonish form beastonish. Importantly, no word in the c ...
Posted on Mon, 17 Aug 2026 16:03:01 +0000 by ryankentp
Backtracking Algorithm Practice: Combination Sum III and Letter Combinations
Problem 216: Combination Sum III
Description: Given two integers k and n, find all possible combinations of k numbers from 1 to 9 that add up to n. Each number can only be used once in a combination.
Approach
This problem requires finding subsets of size k from the set [1,2,3,4,5,6,7,8,9] where the sum equals n. The parameter k represents the d ...
Posted on Sat, 15 Aug 2026 16:09:44 +0000 by heerajee
Tree Problem Summary
Introduction
During the summer vacation, I systematically studied various operations on trees through Teacher Tuo's sharing and discovered many useful techniques, which I now summarize.
Teacher Tuo is amazing!
One
Problem Type: Batch processing queries of the form f(dep(lca(x,y))), where f(x) is a function of x.
Approach: First perform tree ...
Posted on Sat, 01 Aug 2026 16:21:20 +0000 by D_tunisia
Graph Algorithms and Critical Path Analysis in C
Depth-First Search on Adjacency-Matrix Graphs
void DFS(MGraph G, Vertex v, void (*visit)(Vertex)) {
visit(v);
Visited[v] = true;
for (Vertex w = 0; w < G->Nv; ++w)
if (G->G[v][w] && !Visited[w])
DFS(G, w, visit);
}
Breadth-First Search on Adjacency-List Graphs
void BFS(LGraph G, Vertex s, void ...
Posted on Wed, 22 Jul 2026 16:36:11 +0000 by han2754
Determining Graph Connectivity using DFS and BFS
Algorithmic Approach
When handling graph problems, especially those involving large datasets, an adjacency list is often preferred over an adjacency matrix to optimize memory usage, particularly when the vertex count may exceed standard limits. To determine if an undirected graph is connected, one can traverse the structure using either Depth-F ...
Posted on Sun, 19 Jul 2026 16:48:56 +0000 by Jay87
Solutions for 2024 RoboCom CAIP Programming Skills Provincial Competition
RC-u1 Heat Wave
Problem Summary: Given daily maximum temperatures and the day of the week for the first day, count how many days have temperatures ≥ 35°C. Days falling on weekends (Saturday and Sunday) should be counted separately.
Solution: Iterate through the temperature data while tracking the current weekday. For each temperature ≥ 35, incr ...
Posted on Tue, 07 Jul 2026 17:58:05 +0000 by [UW] Jake
Search Algorithms in Problem Solving
Definition
Search algorithms systematically explore state spaces to find optimal solutions or count valid configurations through exhaustive enumeration. This approach leverages understanding of state transitions to navigate possible states.
Search Algorithm Applications
When explicit enumeration becomes infeasible (e.g., permutations for n=100 ...
Posted on Thu, 02 Jul 2026 17:04:03 +0000 by littlejones
Graph Traversal: Searching References
Problem Description
Little K enjoys browsing Luogu blog articles for knowledge. Each article may have several (or none) reference links pointing to other blog articels. Little K is very curious: if he reads an article, he will certainly read its references (unless he has already read that reference).
Assume there are n (n ≤ 10^5) articles on Lu ...
Posted on Wed, 01 Jul 2026 16:36:22 +0000 by coder4Ever
Implementing Inorder Traversal for Binary Trees
To retrieve node values from a binary tree in ascending order (for a BST) or the standard left-root-right sequence, a recursive approach works cleanly. The traversal explores the left subtreee first, records the current node, then visits the right subtree. Below are Python implementations that illustrate this technique.
class TreeNode:
def ...
Posted on Mon, 29 Jun 2026 17:39:32 +0000 by patrikG
Understanding Simulation, DFS/BFS, Dynamic Programming, and Block Decomposition for Competitive Programming
Simulation problems, often labeled as "warm-up" or "signature" tasks in contests, require translating problem statements directly into code without relying on predefined algorithms. While they appear simple, their difficulty lies in accurately interpreting edge cases and constraints. A single oversight in boundary checks or ...
Posted on Sun, 14 Jun 2026 16:51:10 +0000 by ldougherty