← 返回 uber 的题目列表Number of Ways to Earn Points
类型:qbank
Given several question types in an exam, each offering a fixed count of questions worth a fixed number of marks, count the number of distinct ways to score exactly a target number of points. Answers are returned modulo 10^9 + 7.
Number of Ways to Earn Points
Given several question types in an exam, each offering a fixed count of questions worth a fixed number of marks, count the number of distinct ways to score exactly a target number of points. Answers are returned modulo 10^9 + 7.
MLE
dp
math
medium
Frequency
Single report
Last asked
2026-01-05
Stage
phone-screen
Number of Ways to Earn Points
There are types.length question types in an exam. types[i] = [count_i, marks_i] means there are count_i questions worth marks_i points each.
Return the number of different ways to score exactly target points, modulo 10^9 + 7.
Examples
Example 1:
Input: target = 6, types = [[6,1],[3,2],[2,3]]
Output: 7
Constraints
1 <= target <= 1000
1 <= types.length <= 50
1 <= count_i, marks_i <= 50