当前位置:网站首页>Dynamic planning -- expansion topics
Dynamic planning -- expansion topics
2022-07-03 18:47:00 【Lin Shiliu should work hard】
1. Longest ascending subsequence
Interceptor missile issue
For a sequence , seek At least how many ascending sequences can cover
p[i] It means the first one i The maximum number of ascending sequences ,p[i]<p[i+1]
Each time a sequence larger than the maximum number is found , Then update the maximum number
If you can't find it , Just restart a new ascending sequence
for(int i=1;i<=n;i++)
{
int k=0;
while(k<cnt&&p[k]<a[i]) k++;
p[k]=a[i];
if(k>=cnt) cnt++;
}
cout<<res<<endl<<cnt;
Missile intercept plus
187. Missile defense system - AcWing Question bank
The interception sequence can be strictly increasing or decreasing , Ask how many can be covered
Put each number on the rise / Descending sequence
边栏推荐
- application
- 组策略中开机脚本与登录脚本所使用的用户身份
- HOW TO WRITE A DAILY LAB NOTE?
- KINGS
- 2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report
- flask 生成swagger文档
- Have you learned the correct expression posture of programmers on Valentine's day?
- Typescript official website tutorial
- JS_ Array_ sort
- Coordinate layer conversion tool (video)
猜你喜欢
Implementation of cqrs architecture mode under Kratos microservice framework
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
The online customer service system developed by PHP is fully open source without encryption, and supports wechat customer service docking
Web3 credential network project galaxy is better than nym?
SQL: special update operation
2022-2028 global plasmid DNA cdmo industry research and trend analysis report
leetcode:11. 盛最多水的容器【雙指針 + 貪心 + 去除最短板】
G1 garbage collector of garbage collector
2022-2028 global petroleum pipe joint industry research and trend analysis report
Pan for in-depth understanding of the attention mechanism in CV
随机推荐
shell 脚本中关于用户输入参数的处理
[leetcode weekly race] game 300 - 6110 Number of incremental paths in the grid graph - difficult
What does foo mean in programming?
Does SQL always report foreign key errors when creating tables?
Boost. Asio Library
TypeScript 官网教程
Sustainable service business models
Su embedded training - Day10
JS_ Array_ sort
After nohup NPM start &, close the shell window directly, and the process closes accordingly
Common PostgreSQL commands
[combinatorics] generating function (positive integer splitting | unordered non repeated splitting example)
Usage of laravel conditional array in
How about the Moco model?
Briefly describe the quantitative analysis system of services
php-fpm的max_chindren的一些误区
2022-2028 global plasmid DNA cdmo industry research and trend analysis report
Recent learning experience
Day-27 database
Torch learning notes (6) -- logistic regression model (self training)