当前位置:网站首页>【学习笔记】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
边栏推荐
- P3250 [hnoi2016] Network + [necpc2022] f.tree path tree section + segment tree maintenance heap
- Using onvif protocol to operate the device
- MATLAB提取不規則txt文件中的數值數據(簡單且實用)
- Numpy np. Max and np Maximum implements the relu function
- After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials
- 高精度室内定位技术,在智慧工厂安全管理的应用
- Technical experts from large factories: how can engineers improve their communication skills?
- LeetCode 46:全排列
- Asyncio warning deprecationwarning: there is no current event loop
- Oracle withdraw permission & create role
猜你喜欢

Redis things

Matlab extracts numerical data from irregular txt files (simple and practical)

Unity移动端游戏性能优化简谱之 画面表现与GPU压力的权衡

GCC compilation process and dynamic link library and static link library

Solve undefined reference to`__ aeabi_ Uidivmod 'and undefined reference to`__ aeabi_ Uidiv 'error

AI模型看看视频,就学会了玩《我的世界》:砍树、造箱子、制作石镐样样不差...

Multi dimensional monitoring: the data base of intelligent monitoring

Processes and threads

Résumé des questions d'entrevue (2) Modèle io, ensemble, principe NiO, pénétration du cache, avalanche de rupture

【obs】obs的ini格式的ConfigFile
随机推荐
如何成为一名高级数字 IC 设计工程师(1-5)Verilog 编码语法篇:操作数
表空间创建管理及控制文件管理
phpcms 提示信息頁面跳轉showmessage
Numpy np.max和np.maximum实现relu函数
Solicitation for JGG special issue: spatio-temporal omics
CSRF
ASP.NET-酒店管理系統
Nestjs配置服务,配置Cookie和Session
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
GCC compilation process and dynamic link library and static link library
【obs】obs的ini格式的ConfigFile
DS90UB949
FL Studio 20无限试用版水果编曲下载
Use typora to draw flow chart, sequence diagram, sequence diagram, Gantt chart, etc. for detailed explanation
Dynamic programming (interval DP)
phpcms 提示信息页面跳转showmessage
uniapp实现点击加载更多
Static library vs shared library
How to become a senior digital IC Design Engineer (1-3) Verilog coding syntax: Verilog behavior level, register transfer level, gate level (abstract level)
Oracle withdraw permission & create role