当前位置:网站首页>【学习笔记】dp 状态与转移
【学习笔记】dp 状态与转移
2022-07-03 10:43:00 【仰望星空的蚂蚁】
Ehab and the Expected GCD Problem
思维还是慢了一步 。
observations + dp 。
这题难在 dp 阶段的设计 。 我们考虑从前往后向序列中填数 ,同时记录当前前缀 gcd 状态。
dp[i][j][k] 表示考虑了前 i 个数,前缀 gcd = 2 j 3 k ( k = 0 / 1 ) \gcd=2^\text{j}3^\text{k}(k=0/1) gcd=2j3k(k=0/1) 。转移是巧妙的 。(乘法原理)
Three Servers
看完题意我是 joker …
简单的背包问题可以让你怀疑人生 …
可达性 dp -> 最优性 dp
observations + dp
同为可达性 dp :https://blog.csdn.net/cqbzlydd/article/details/124870640?spm=1001.2014.3001.5501
Hero meet devil
毋宁是状压好题 。
observations + dp
Min Product Sum
dp(x)
数学(v)
干瞪眼大法 …
我怎么看不懂题解啊
Salvage Robots
大受震撼 …
强行构造状态和dp阶段 …
膜拜 idsy …
考虑中间有一个安全区域 … 四周为危险区域 …
考虑将安全区域拖动,这样危险区域中的一些 robot 会被甩出去 …
设 d p [ a ] [ b ] [ c ] [ d ] dp[a][b][c][d] dp[a][b][c][d] 表示安全区域左上角为 ( a , b ) (a,b) (a,b),右下角为 ( c , d ) (c,d) (c,d) ,在危险区域能救起的 robot 的最大数量 。
至于转移,预处理 Up[i][l][x] 表示第 i 列 [1,l] 的 robot 向上移动不超过 x 步能到达 E 的数量
上下左右四个方向类似 。
转移时考虑这个安全区域往里缩 :

d p [ a ] [ b ] [ c ] [ d ] + ? → d p [ a ] [ b + 1 ] [ c ] [ d ] dp[a][b][c][d]+?\to dp[a][b+1][c][d] dp[a][b][c][d]+?→dp[a][b+1][c][d]
上下左右四个方向同理 。
答案 max ( d p [ i ] [ j ] [ i ] [ j ] + 1 ) ( s [ i ] [ j ] = o ) \max(dp[i][j][i][j]+1)(s[i][j]=o) max(dp[i][j][i][j]+1)(s[i][j]=o) 。因为最后一个 robot 一定是安全的 。
这题的状态和阶段太难想到了 。毋宁称之为构造dp题 。
Prefix Median
AGCAGCAGC
边栏推荐
- Empire CMS no thumbnail smart tag (e:loop) two ways to judge whether there is a titlepic
- C language log base zlog basic use
- Program process management tool -go Supervisor
- CSRF
- 读书笔记:《心若菩提》 曹德旺
- Phpcms prompt message page Jump showmessage
- Redis things
- Hal - General
- How to get started embedded future development direction of embedded
- 如何成为一名高级数字 IC 设计工程师(1-4)Verilog 编码语法篇:表达式
猜你喜欢

面试题总结(2) IO模型,集合,NIO 原理,缓存穿透,击穿雪崩

高精度室内定位技术,在智慧工厂安全管理的应用

MATLAB提取不規則txt文件中的數值數據(簡單且實用)

行业唯一!法大大电子合同上榜36氪硬核科技企业

Numpy np.max和np.maximum实现relu函数

机器学习 3.2 决策树模型 学习笔记(待补)

面試題總結(2) IO模型,集合,NIO 原理,緩存穿透,擊穿雪崩

用了这么久线程池,你真的知道如何合理配置线程数吗?

Abandon the Internet after 00: don't want to enter a big factory after graduation, but go to the most fashionable Web3

GCC compilation process and dynamic link library and static link library
随机推荐
Google Earth engine (GEE) - ghsl global population grid dataset 250 meter resolution
Machine learning 3.2 decision tree model learning notes (to be supplemented)
Driver development based on I2C protocol
Empire CMS no thumbnail smart tag (e:loop) two ways to judge whether there is a titlepic
Tablespace creation management and control file management
多维度监控:智能监控的数据基础
高精度室内定位技术,在智慧工厂安全管理的应用
Intel 13th generation core flagship exposure, single core 5.5ghz
抓包整理外篇fiddler———— 会话栏与过滤器[二]
phpcms 提示信息页面跳转showmessage
面试题总结(2) IO模型,集合,NIO 原理,缓存穿透,击穿雪崩
How to become a senior digital IC Design Engineer (1-2) Verilog coding syntax: Verilog 1995, 2001, 2005 standards
基于turtlebot3实现SLAM建图及自主导航仿真
Touch and screen automatic rotation debugging
Cuiyusong, CTO of youzan: the core goal of Jarvis is to make products smarter and more reliable
Solve undefined reference to`__ aeabi_ Uidivmod 'and undefined reference to`__ aeabi_ Uidiv 'error
Event preview | the live broadcast industry "rolled in" to drive new data growth points with product power
How to clean up v$rman_ backup_ job_ Details view reports error ora-02030
Mmc5603nj geomagnetic sensor (Compass example)
After using the thread pool for so long, do you really know how to reasonably configure the number of threads?