In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the golang brush leetcode dynamic planning how to solve the problem of profit planning, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
There are G members in the gang who may commit all kinds of crimes.
The type I crime generates profits from profit [I], which requires the participation of group [I] members.
Let's call any subset of these crimes a profit plan, which generates at least P profits.
How many options are available? Because the answer is large, it returns a value of 10 ^ 9 + 7.
Example 1:
Input: G = 5, P = 3, group = [2jue 2], profit = [2pr 3]
Output: 2
Explanation:
Generate at least 3% of the profit, the gang can commit crime 0 and crime 1, or only crime 1.
In general, there are two options.
Example 2:
Input: G = 10, P = 5, group = [2Jing 3JEI 5], profit = [6Jing 7JI 8]
Output: 7
Explanation:
Generate at least 5% profit, as long as they commit one of these crimes, so the gang can commit any crime.
There are seven possible plans: (0), (1), (2), (0meme1), (0meme2), (1meme2), and (0meme1mem2).
Tip:
one
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.