赫he
赫he
全部文章
题解
归档
标签
去牛客网
登录
/
注册
赫he的博客
全部文章
/ 题解
(共3篇)
题解 | #两个序列#
将数组a中的数字变成和数组b中的数字顺序一样(两个序列都是由相同的无重复数字集合组成的),可以通过将每个唯一的数字映射到唯一的下标上。目标数组b中,记b[pos1]=b1,b[pos2]=b2,...,b[posj]=bj,...,b[posn]=bnb[pos_1]= b_1,b[pos_2]= ...
C++
2023-05-16
1
282
题解 | #方案数量#
dfs超时,bp可以过 bp:f[a][b]=f[a][b]+f[i][j] 其中(a,b)是(i,j)所能在能量范围内到达的位置,记录该位置能到达几次,到了f[n][m]就是有多少条路径可以到终点。 #include <iostream> #include <vector>...
C++
动态规划
深度优先搜索
2023-05-15
0
477
题解 | #树上最短链# 邻接表和bfs
#include <iostream> #include <algorithm> #include <cmath> #include <queue> #include <cstring> using namespace std; //无向边...
C++
2023-05-14
0
331