Tap here to switch tabs
Problem
Submissions

Problem: Profitable Schemes

Profitable Schemes asks you to count crime subsets whose required members fit the group and whose total profit reaches the minimum, returning the count modulo a large prime.

Statement

There is a group of n members, and a list of crimes that can be committed. For each crime at index i, group[i] members are required to participate, and it generates a profit of profit[i].

A scheme is a subset of crimes. A scheme is valid and profitable if the total number of members required does not exceed n, and the total profit generated is at least minProfit.

Return the total number of profitable schemes. Since the answer may be large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤100\leq 100

  • 0≤0 \leq minProfit ≤100\leq 100

  • 1≤1 \leq group.length ≤100\leq 100

  • 1≤1 \leq group[i] ≤100\leq 100

  • profit.length ==== group.length

  • 0≤0 \leq profit[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Profitable Schemes

Profitable Schemes asks you to count crime subsets whose required members fit the group and whose total profit reaches the minimum, returning the count modulo a large prime.

Statement

There is a group of n members, and a list of crimes that can be committed. For each crime at index i, group[i] members are required to participate, and it generates a profit of profit[i].

A scheme is a subset of crimes. A scheme is valid and profitable if the total number of members required does not exceed n, and the total profit generated is at least minProfit.

Return the total number of profitable schemes. Since the answer may be large, return it modulo 109+710^9 + 7.

Constraints:

  • 1≤1 \leq n ≤100\leq 100

  • 0≤0 \leq minProfit ≤100\leq 100

  • 1≤1 \leq group.length ≤100\leq 100

  • 1≤1 \leq group[i] ≤100\leq 100

  • profit.length ==== group.length

  • 0≤0 \leq profit[i] ≤100\leq 100