sum~
sum~
全部文章
分类
题解(5)
归档
标签
去牛客网
登录
/
注册
sum~的博客
全部文章
(共4篇)
题解 | #学生查询#
(1)dp数组含义:dp[x][y]表示到达(x, y)的路径条数 (2)递推公式:dp[i][j] = dp[i-1][j] + dp[i][j - 1];(因为卒只可以向右或者向下走) (3)初始化:dp[0][0] = 1,根据马的坐标(x, y),可以将(x,y)和马可以到达的八个点的坐标对...
C++
2022-03-21
1
298
题解 | #学生查询#
本题难点在于负数的处理 我的处理过程:使用temp记录当前访问元素之前最近出现的负数的下标, 当前元素为负数时,首先先将数据累乘过去;然后当temp >= 1时,转态转移方程为:dp[i] = max(dp[i], dp[i] * dp[temp - 1]); 当前元素为正数时,转态转移方...
C++
2022-03-19
1
248
题解 | #学生查询#
//哈希 #include <iostream> #include <cstdio> #include <string> using namespace std; const int MAXN = 128; int main() { &...
C++
哈希表
2022-03-03
0
201
题解 | #学生查询#
//C++使用map实现学生查询 //映射关系为:学号-->学生所有信息 #include #include #include #include using namespace std; int main() { int m, n; string str; scanf("%d", &a...
C++
2022-02-28
0
268