<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="rss.xsl"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title>Algorithms for Competitive Programming</title><description>The goal of this project is to translate the wonderful resource http://e-maxx.ru/algo which provides descriptions of many algorithms and data structures especially popular in field of competitive programming. Moreover we want to improve the collected knowledge by extending the articles and adding new articles to the collection.</description><link>https://cp-algorithms.com/</link><atom:link href="https://cp-algorithms.com/feed_rss_updated.xml" rel="self" type="application/rss+xml" /> <docs>https://github.com/cp-algorithms/cp-algorithms</docs><language>en</language> <pubDate>Sat, 17 Oct 2026 19:32:59 -0000</pubDate> <lastBuildDate>Sat, 17 Oct 2026 19:32:59 -0000</lastBuildDate> <ttl>1440</ttl> <generator>MkDocs RSS plugin - v1.19.0</generator> <image> <url>None</url> <title>Algorithms for Competitive Programming</title> <link>https://cp-algorithms.com/</link> </image> <item> <title>Gray code</title> <description>&lt;h1&gt;Gray code&lt;/h1&gt; &lt;p&gt;Gray code is a binary numeral system where two successive values differ in only one bit. &lt;/p&gt; &lt;p&gt;Denote by $G(n)$ the representation of the number $n$...&lt;/p&gt;</description> <link>https://cp-algorithms.com/algebra/gray-code.html</link> <pubDate>Sat, 17 Oct 2026 04:36:28 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/gray-code.html</guid> </item> <item> <title>Segment Tree</title> <description>&lt;h1&gt;Segment Tree&lt;/h1&gt; &lt;p&gt;A Segment Tree is a data structure that stores information about array intervals as a tree. This allows answering range queries over an array...&lt;/p&gt;</description> <link>https://cp-algorithms.com/data_structures/segment_tree.html</link> <pubDate>Sun, 04 Oct 2026 19:00:33 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/data_structures/segment_tree.html</guid> </item> <item> <title>Disjoint Set Union</title> <description>&lt;h1&gt;Disjoint Set Union&lt;/h1&gt; &lt;p&gt;This article discusses the data structure &lt;strong&gt;Disjoint Set Union&lt;/strong&gt; or &lt;strong&gt;DSU&lt;/strong&gt;. Often it is also called &lt;strong&gt;Union Find&lt;/strong&gt; because of its two ...&lt;/p&gt;</description> <link>https://cp-algorithms.com/data_structures/disjoint_set_union.html</link> <pubDate>Sat, 19 Sep 2026 12:39:39 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/data_structures/disjoint_set_union.html</guid> </item> <item> <title>Binary Search</title> <description>&lt;h1&gt;Binary search&lt;/h1&gt; &lt;p&gt;&lt;strong&gt;Binary search&lt;/strong&gt; is a method that allows for quicker search of something by splitting the search interval into two. Its most common applica...&lt;/p&gt;</description> <link>https://cp-algorithms.com/num_methods/binary_search.html</link> <pubDate>Sat, 19 Sep 2026 11:59:27 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/num_methods/binary_search.html</guid> </item> <item> <title>0-1 BFS</title> <description>&lt;h1&gt;0-1 BFS&lt;/h1&gt; &lt;p&gt;It is well-known, that you can find the shortest paths between a single source and all other vertices in $O(|E|)$ using [Breadth First Search](bre...&lt;/p&gt;</description> <link>https://cp-algorithms.com/graph/01_bfs.html</link> <pubDate>Sat, 19 Sep 2026 11:15:44 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/graph/01_bfs.html</guid> </item> <item> <title>Convex hull construction</title> <description>&lt;h1&gt;Convex Hull construction&lt;/h1&gt; &lt;p&gt;In this article we will discuss the problem of constructing a convex hull from a set of points.&lt;/p&gt; &lt;p&gt;Consider $N$ points given on a p...&lt;/p&gt;</description> <link>https://cp-algorithms.com/geometry/convex-hull.html</link> <pubDate>Sat, 19 Sep 2026 10:34:59 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/geometry/convex-hull.html</guid> </item> <item> <title>Lowest Common Ancestor - Binary Lifting</title> <description>&lt;h1&gt;Lowest Common Ancestor - Binary Lifting&lt;/h1&gt; &lt;p&gt;Let $G$ be a tree. For every query of the form &lt;code&gt;(u, v)&lt;/code&gt; we want to find the lowest common ancestor of the nodes `u...&lt;/p&gt;</description> <link>https://cp-algorithms.com/graph/lca_binary_lifting.html</link> <pubDate>Sat, 19 Sep 2026 10:31:06 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/graph/lca_binary_lifting.html</guid> </item> <item> <title>Knapsack Problem</title> <description>&lt;h1&gt;Knapsack Problem&lt;/h1&gt; &lt;p&gt;Prerequisite knowledge: &lt;a href=&#34;https://cp-algorithms.com/dynamic_programming/intro-to-dp.html&#34;&gt;Introduction to Dynamic Programming&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Introduc...&lt;/h2&gt;</description> <link>https://cp-algorithms.com/dynamic_programming/knapsack.html</link> <pubDate>Fri, 18 Sep 2026 21:47:54 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/dynamic_programming/knapsack.html</guid> </item> <item> <title>Primality tests</title> <description>&lt;h1&gt;Primality tests&lt;/h1&gt; &lt;p&gt;This article describes multiple algorithms to determine if a number is prime or not.&lt;/p&gt; &lt;h2&gt;Trial division&lt;/h2&gt; &lt;p&gt;By definition a prime number does...&lt;/p&gt;</description> <link>https://cp-algorithms.com/algebra/primality_tests.html</link> <pubDate>Fri, 18 Sep 2026 21:24:31 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/primality_tests.html</guid> </item> <item> <title>Bit manipulation</title> <description>&lt;h1&gt;Bit manipulation&lt;/h1&gt; &lt;h2&gt;Binary number&lt;/h2&gt; &lt;p&gt;A &lt;strong&gt;binary number&lt;/strong&gt; is a number expressed in the base-2 numeral system or binary numeral system, it is a method of math...&lt;/p&gt;</description> <link>https://cp-algorithms.com/algebra/bit-manipulation.html</link> <pubDate>Fri, 18 Sep 2026 19:35:15 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/bit-manipulation.html</guid> </item> <item> <title>Longest increasing subsequence</title> <description>&lt;h1&gt;Longest increasing subsequence&lt;/h1&gt; &lt;p&gt;We are given an array with $n$ numbers: $a[0 \dots n-1]$. The task is to find the longest, strictly increasing, subsequence...&lt;/p&gt;</description> <link>https://cp-algorithms.com/dynamic_programming/longest_increasing_subsequence.html</link> <pubDate>Fri, 18 Sep 2026 19:17:46 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/dynamic_programming/longest_increasing_subsequence.html</guid> </item> <item> <title>Knuth&#39;s Optimization</title> <description>&lt;h1&gt;Knuth&#39;s Optimization&lt;/h1&gt; &lt;p&gt;Knuth&#39;s optimization, also known as the Knuth-Yao Speedup, is a special case of dynamic programming on ranges, that can optimize the ...&lt;/p&gt;</description> <link>https://cp-algorithms.com/dynamic_programming/knuth-optimization.html</link> <pubDate>Fri, 18 Sep 2026 18:39:58 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/dynamic_programming/knuth-optimization.html</guid> </item> <item> <title>Bellman-Ford - finding shortest paths with negative weights</title> <description>&lt;h1&gt;Bellman-Ford Algorithm&lt;/h1&gt; &lt;p&gt;&lt;strong&gt;Single source shortest path with negative weight edges&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Suppose that we are given a weighted directed graph $G$ with $n$ vertic...&lt;/p&gt;</description> <link>https://cp-algorithms.com/graph/bellman_ford.html</link> <pubDate>Fri, 18 Sep 2026 18:36:06 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/graph/bellman_ford.html</guid> </item> <item> <title>Check if points belong to the convex polygon in O(log N)</title> <description>&lt;h1&gt;Check if point belongs to the convex polygon in $O(\log N)$&lt;/h1&gt; &lt;p&gt;Consider the following problem: you are given a convex polygon with integer vertices and a lot...&lt;/p&gt;</description> <link>https://cp-algorithms.com/geometry/point-in-convex-polygon.html</link> <pubDate>Fri, 18 Sep 2026 18:17:04 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/geometry/point-in-convex-polygon.html</guid> </item> <item> <title>Sieve of Eratosthenes</title> <description>&lt;h1&gt;Sieve of Eratosthenes&lt;/h1&gt; &lt;p&gt;Sieve of Eratosthenes is an algorithm for finding all the prime numbers in a segment $[1;n]$ using $O(n \log \log n)$ operations.&lt;/p&gt; &lt;p&gt;T...&lt;/p&gt;</description> <link>https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html</link> <pubDate>Fri, 18 Sep 2026 18:10:07 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/sieve-of-eratosthenes.html</guid> </item> <item> <title>Finding Power of Factorial Divisor</title> <description>&lt;h1&gt;Finding Power of Factorial Divisor&lt;/h1&gt; &lt;p&gt;You are given two numbers $n$ and $k$. Find the largest integer $x$ such that $k^x$ divides $n!$.&lt;/p&gt; &lt;h2&gt;Prime $k$ {data-t...&lt;/h2&gt;</description> <link>https://cp-algorithms.com/algebra/factorial-divisors.html</link> <pubDate>Fri, 18 Sep 2026 18:03:40 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/factorial-divisors.html</guid> </item> <item> <title>Factorial modulo p</title> <description>&lt;h1&gt;Factorial modulo $p$&lt;/h1&gt; &lt;p&gt;In some cases it is necessary to consider complex formulas modulo some prime $p$, containing factorials in both numerator and denomin...&lt;/p&gt;</description> <link>https://cp-algorithms.com/algebra/factorial-modulo.html</link> <pubDate>Fri, 18 Sep 2026 18:03:40 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/algebra/factorial-modulo.html</guid> </item> <item> <title>Catalan Numbers</title> <description>&lt;h1&gt;Catalan Numbers&lt;/h1&gt; &lt;p&gt;Catalan numbers form a number sequence which is useful in a number of combinatorial problems, often involving recursively-defined objects. ...&lt;/p&gt;</description> <link>https://cp-algorithms.com/combinatorics/catalan-numbers.html</link> <pubDate>Fri, 18 Sep 2026 17:59:44 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/combinatorics/catalan-numbers.html</guid> </item> <item> <title>The Inclusion-Exclusion Principle</title> <description>&lt;h1&gt;The Inclusion-Exclusion Principle&lt;/h1&gt; &lt;p&gt;The inclusion-exclusion principle is an important combinatorial way to compute the size of a set or the probability of c...&lt;/p&gt;</description> <link>https://cp-algorithms.com/combinatorics/inclusion-exclusion.html</link> <pubDate>Fri, 18 Sep 2026 17:59:44 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/combinatorics/inclusion-exclusion.html</guid> </item> <item> <title>Newton&#39;s method for finding roots</title> <description>&lt;h1&gt;Newton&#39;s method for finding roots&lt;/h1&gt; &lt;p&gt;This is an iterative method invented by Isaac Newton around 1664. However, this method is also sometimes called the Rap...&lt;/p&gt;</description> <link>https://cp-algorithms.com/num_methods/roots_newton.html</link> <pubDate>Fri, 18 Sep 2026 17:30:18 +0000</pubDate> <source url="https://cp-algorithms.com/feed_rss_updated.xml">Algorithms for Competitive Programming</source><guid isPermaLink="true">https://cp-algorithms.com/num_methods/roots_newton.html</guid> </item> </channel> </rss>