Блог пользователя YouKn0wWho

Автор YouKn0wWho, 4 года назад, По-английски

Find the number of ways to select $$$k$$$ non-intersecting edges from a linear graph with $$$n$$$ nodes. In a linear graph every $$$i$$$ and $$$(i - 1)$$$ is connected by an undirected edge for each $$$i$$$ from $$$2$$$ to $$$n$$$.

Two edges intersect if they share some node. Two ways are different if there is some edge which is selected in one way but in the other.

Constraints: $$$1 \leq k < n \leq 10^5$$$

  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

$$$\binom{n-k}{k}$$$