当前位置:网站首页>【学习笔记】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
边栏推荐
- After setting up ADG, instance 2 cannot start ora-29760: instance_ number parameter not specified
- Modular programming of single chip microcomputer
- repo ~ 常用命令
- FL Studio 20 unlimited trial fruit arranger Download
- C language log base zlog basic use
- MATLAB extrait les données numériques d'un fichier txt irrégulier (simple et pratique)
- Cuiyusong, CTO of youzan: the core goal of Jarvis is to make products smarter and more reliable
- Reading notes: heart like Bodhi, Cao Dewang
- C language two-dimensional array
- Android log system
猜你喜欢

DS90UB949

Mmc5603nj geomagnetic sensor (Compass example)

Processes and threads

Incremental database backup - DB incr DB full

基于turtlebot3实现SLAM建图及自主导航仿真

GCC compilation process and dynamic link library and static link library

Analysis of EPS electric steering system

Cadence background color setting

MATLAB extrait les données numériques d'un fichier txt irrégulier (simple et pratique)

After a month, I finally got Kingdee offer! Share tetrahedral Sutra + review materials
随机推荐
Phpcms prompt message page Jump showmessage
How to become a senior digital IC Design Engineer (1-4) Verilog coding syntax: expression
GCC compilation process and dynamic link library and static link library
如何成为一名高级数字 IC 设计工程师(1-3)Verilog 编码语法篇:Verilog 行为级、寄存器传输级、门级(抽象级别)
Using onvif protocol to operate the device
VPP三层网络互联配置
FL Studio 20 unlimited trial fruit arranger Download
Oracle 11g single machine cold standby database
P3250 [HNOI2016] 网络 + [NECPC2022] F.Tree Path 树剖+线段树维护堆
MATLAB提取不规则txt文件中的数值数据(简单且实用)
Incremental database backup - DB incr DB full
This article explains the complex relationship between MCU, arm, MCU, DSP, FPGA and embedded system
(2) Base
PHP基础
Analysis of EPS electric steering system
Machine learning 3.2 decision tree model learning notes (to be supplemented)
Bi skills - permission axis
Some common terms
基于turtlebot3实现SLAM建图及自主导航仿真
The manuscript will be revised for release tonight. But, still stuck here, maybe what you need is a paragraph.