mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Update backtracking/magic_sequence.cpp
Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
parent
f713beb132
commit
647a3c4a2e
@ -5,8 +5,8 @@
|
||||
* @details Solve the magic sequence problem with a backtraking
|
||||
*
|
||||
* "A magic sequence of length $n$ is a sequence of integers $x_0
|
||||
* \ldots x_{n-1}$ between $0$ and $n-1$, such that for all $i$
|
||||
* in $0$ to $n-1$, the number $i$ occurs exactly $x_i$ times in
|
||||
* \ldots x_{n-1}$ between $0$ and $n-1$, such that for all $i$
|
||||
* in $0$ to $n-1$, the number $i$ occurs exactly $x_i$ times in
|
||||
* the sequence. For instance, $6,2,1,0,0,0,1,0,0,0$ is a magic
|
||||
* sequence since $0$ occurs $6$ times in it, $1$ occurs twice, etc."
|
||||
* Quote taken from the [CSPLib](https://www.csplib.org/Problems/prob019/) website
|
||||
|
Loading…
x
Reference in New Issue
Block a user