Skip to content

Commit 4c3630d

Browse files
committed
2 parents 411ddb5 + b12e2b1 commit 4c3630d

21 files changed

+317
-21
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Compiled pages are published at [https://cp-algorithms.com/](https://cp-algorith
1616

1717
## Changelog
1818

19+
- August, 2025: Overhaul of CP-Algorithms [donation system](https://github.com/sponsors/cp-algorithms). Please consider supporting us, so that we can grow!
20+
- August, 2025: Launched a [Discord server](https://discord.gg/HZ5AecN3KX)!
1921
- October, 2024: Welcome new maintainers: [jxu](https://github.com/jxu), [mhayter](https://github.com/mhayter) and [kostero](https://github.com/kostero)!
2022
- October, 15, 2024: GitHub pages based mirror is now served at [https://gh.cp-algorithms.com/](https://gh.cp-algorithms.com/), and an auxiliary competitive programming library is available at [https://lib.cp-algorithms.com/](https://lib.cp-algorithms.com/).
2123
- July 16, 2024: Major overhaul of the [Finding strongly connected components / Building condensation graph](https://cp-algorithms.com/graph/strongly-connected-components.html) article.
@@ -29,6 +31,7 @@ Compiled pages are published at [https://cp-algorithms.com/](https://cp-algorith
2931

3032
### New articles
3133

34+
- (19 August 2025) [Minimum Enclosing Circle](https://cp-algorithms.com/geometry/enclosing-circle.html)
3235
- (21 May 2025) [Simulated Annealing](https://cp-algorithms.com/num_methods/simulated_annealing.html)
3336
- (12 July 2024) [Manhattan distance](https://cp-algorithms.com/geometry/manhattan-distance.html)
3437
- (8 June 2024) [Knapsack Problem](https://cp-algorithms.com/dynamic_programming/knapsack.html)

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ edit_uri: edit/main/src/
3131
copyright: Text is available under the <a href="https://github.com/cp-algorithms/cp-algorithms/blob/main/LICENSE">Creative Commons Attribution Share Alike 4.0 International</a> License<br/>Copyright &copy; 2014 - 2025 by <a href="https://github.com/cp-algorithms/cp-algorithms/graphs/contributors">cp-algorithms contributors</a>
3232
extra_javascript:
3333
- javascript/config.js
34+
- javascript/donation-banner.js
3435
- https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6
3536
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
3637
extra_css:
@@ -79,6 +80,13 @@ plugins:
7980
- rss
8081

8182
extra:
83+
social:
84+
- icon: fontawesome/brands/github
85+
link: https://github.com/cp-algorithms/cp-algorithms
86+
- icon: fontawesome/brands/discord
87+
link: https://discord.gg/HZ5AecN3KX
88+
- icon: fontawesome/solid/circle-dollar-to-slot
89+
link: https://github.com/sponsors/cp-algorithms
8290
analytics:
8391
provider: google
8492
property: G-7FLS2HCYHH

src/algebra/binary-exp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ a_{31} & a_ {32} & a_ {33} & a_ {34} \\
177177
a_{41} & a_ {42} & a_ {43} & a_ {44}
178178
\end{pmatrix}$$
179179

180-
that, when multiplied by a vector with the old coordinates and an unit gives a new vector with the new coordinates and an unit:
180+
that, when multiplied by a vector with the old coordinates and a unit gives a new vector with the new coordinates and a unit:
181181

182182
$$\begin{pmatrix} x & y & z & 1 \end{pmatrix} \cdot
183183
\begin{pmatrix}

src/algebra/chinese-remainder-theorem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ $$\left\{\begin{align}
154154
a & \equiv 2 \pmod{6}
155155
\end{align}\right.$$
156156

157-
It is pretty simple to determine is a system has a solution.
157+
It is pretty simple to determine if a system has a solution.
158158
And if it has one, we can use the original algorithm to solve a slightly modified system of congruences.
159159

160160
A single congruence $a \equiv a_i \pmod{m_i}$ is equivalent to the system of congruences $a \equiv a_i \pmod{p_j^{n_j}}$ where $p_1^{n_1} p_2^{n_2}\cdots p_k^{n_k}$ is the prime factorization of $m_i$.

src/algebra/discrete-log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ With this change, the complexity of the algorithm is still the same, but now the
129129
Instead of a `map`, we can also use a hash table (`unordered_map` in C++) which has the average time complexity $O(1)$ for inserting and searching.
130130

131131
Problems often ask for the minimum $x$ which satisfies the solution.
132-
It is possible to get all answers and take the minimum, or reduce the first found answer using [Euler's theorem](phi-function.md#toc-tgt-2), but we can be smart about the order in which we calculate values and ensure the first answer we find is the minimum.
132+
It is possible to get all answers and take the minimum, or reduce the first found answer using [Euler's theorem](phi-function.md#application), but we can be smart about the order in which we calculate values and ensure the first answer we find is the minimum.
133133

134134
```{.cpp file=discrete_log}
135135
// Returns minimum x for which a ^ x % m = b % m, a and m are coprime.

src/algebra/linear-diophantine-equation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $$a x_g + b y_g = g$$
6363

6464
If $c$ is divisible by $g = \gcd(a, b)$, then the given Diophantine equation has a solution, otherwise it does not have any solution. The proof is straight-forward: a linear combination of two numbers is divisible by their common divisor.
6565

66-
Now supposed that $c$ is divisible by $g$, then we have:
66+
Now suppose that $c$ is divisible by $g$, then we have:
6767

6868
$$a \cdot x_g \cdot \frac{c}{g} + b \cdot y_g \cdot \frac{c}{g} = c$$
6969

src/algebra/polynomial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ This algorithm was mentioned in [Schönhage's article](http://algo.inria.fr/semi
192192

193193
$$A^{-1}(x) \equiv \frac{1}{A(x)} \equiv \frac{A(-x)}{A(x)A(-x)} \equiv \frac{A(-x)}{T(x^2)} \pmod{x^k}$$
194194

195-
Note that $T(x)$ can be computed with a single multiplication, after which we're only interested in the first half of coefficients of its inverse series. This effectively reduces the initial problem of computing $A^{-1} \pmod{x^k}$ to computing $T^{-1} \pmod{x^{\lfloor k / 2 \rfloor}}$.
195+
Note that $T(x)$ can be computed with a single multiplication, after which we're only interested in the first half of coefficients of its inverse series. This effectively reduces the initial problem of computing $A^{-1} \pmod{x^k}$ to computing $T^{-1} \pmod{x^{\lceil k / 2 \rceil}}$.
196196

197197
The complexity of this method can be estimated as
198198

src/combinatorics/burnside.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,4 @@ int solve(int n, int m) {
280280
* [SPOJ - Sorting Machine](https://www.spoj.com/problems/SRTMACH/)
281281
* [Project Euler - Pizza Toppings](https://projecteuler.net/problem=281)
282282
* [ICPC 2011 SERCP - Alphabet Soup](https://basecamp.eolymp.com/tr/problems/3064)
283-
* [GCPC 2017 - Buildings](https://basecamp.eolymp.com/en/problems/11615)
283+
* [GCPC 2017 - Buildings](https://basecamp.eolymp.com/en/problems/11615)

src/data_structures/stack_queue_modification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ first we will modify a stack in a way that allows us to find the smallest elemen
1111

1212
## Stack modification
1313

14-
We want to modify the stack data structure in such a way, that it possible to find the smallest element in the stack in $O(1)$ time, while maintaining the same asymptotic behavior for adding and removing elements from the stack.
14+
We want to modify the stack data structure in such a way, that it is possible to find the smallest element in the stack in $O(1)$ time, while maintaining the same asymptotic behavior for adding and removing elements from the stack.
1515
Quick reminder, on a stack we only add and remove elements on one end.
1616

1717
To do this, we will not only store the elements in the stack, but we will store them in pairs: the element itself and the minimum in the stack starting from this element and below.

src/geometry/basic-geometry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ double angle(point2d a, point2d b) {
180180
```
181181

182182
To see the next important property we should take a look at the set of points $\mathbf r$ for which $\mathbf r\cdot \mathbf a = C$ for some fixed constant $C$.
183-
You can see that this set of points is exactly the set of points for which the projection onto $\mathbf a$ is the point $C \cdot \dfrac{\mathbf a}{|\mathbf a|}$ and they form a hyperplane orthogonal to $\mathbf a$.
183+
You can see that this set of points is exactly the set of points for which the projection onto $\mathbf a$ is the point $C \cdot \dfrac{\mathbf a}{|\mathbf a| ^ 2}$ and they form a hyperplane orthogonal to $\mathbf a$.
184184
You can see the vector $\mathbf a$ alongside with several such vectors having same dot product with it in 2D on the picture below:
185185

186186
<div style="text-align: center;">

0 commit comments

Comments
 (0)