![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
搜索
HangShao99
将来的你一定会感谢现在拼命的自己~~~~
展开
-
dfs搜索+剪枝
C - Sticks George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks...原创 2018-07-16 17:14:36 · 530 阅读 · 0 评论 -
动态规划(记忆化搜索)
D - 滑雪 Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 21...原创 2018-07-18 14:56:59 · 670 阅读 · 1 评论 -
Stealing Harry Potter's Precious (bfs)
Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back to uncle Vernon's home. But he can't bring his pr...原创 2018-10-25 20:39:02 · 397 阅读 · 0 评论 -
BFS求最小拐弯数
题目:http://acm.wust.edu.cn/problem.php?cid=1321&pid=4 分析:就是求起点到终点的最小拐弯数+1,用一个turn[x][y]维护每个点的最小拐弯数,如果扩展出的节点的拐弯数更小或等于,就把turn数组更新并把该点加进队列中去。 还有用i=0,1,2,3来代表四个方向,如果方向改变了说明转弯了,并用-1代表最初的方向,最初向哪边都不算转弯。...原创 2019-01-20 20:48:19 · 879 阅读 · 0 评论 -
hdu6665(离散化+bfs)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6665 题意:两个矩形能把平面分割为多少个部分 比赛时都是疯狂if else 做的,写了200+行,然鹅我不想写这种繁琐的,就没写.... 考虑简洁明了的方法,先把坐标离散化,然后把矩形边界标记为1,每次从标记为0的开始bfs,把访问过的点标记为1,由于矩形边界被标记为1了,矩形外面的点bfs时进...原创 2019-08-14 20:37:23 · 174 阅读 · 0 评论