Tap here to switch tabs
Problem
Submissions

Problem: Number of Sets of K Non-Overlapping Line Segments

med
30 min
Try to solve the Number of Sets of K Non-Overlapping Line Segments problem.

Statement

Given 11D points on a line labeled from 00 to n −1- 1, find the total number of ways to draw k non-overlapping line segments.

Each segment must connect two distinct integer points with positive length. Two segments are considered non-overlapping if they do not cover any common interval of positive length. They are allowed to share an endpoint.

Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 2≤2 \leq n ≤1000\leq 1000

  • 1≤1 \leq k ≤\leq n −1- 1

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Sets of K Non-Overlapping Line Segments

med
30 min
Try to solve the Number of Sets of K Non-Overlapping Line Segments problem.

Statement

Given 11D points on a line labeled from 00 to n −1- 1, find the total number of ways to draw k non-overlapping line segments.

Each segment must connect two distinct integer points with positive length. Two segments are considered non-overlapping if they do not cover any common interval of positive length. They are allowed to share an endpoint.

Since the answer may be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 2≤2 \leq n ≤1000\leq 1000

  • 1≤1 \leq k ≤\leq n −1- 1