![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
王20133
俯下身,低下头
展开
-
DFS HDU1518
传送门题意就是好多棍子,看能不能拼成正方形。主要注意的有几点:所有棍子都要用到,不能剩余输入已经保证大于4根棍子了。所以无需判断可能小于3根棍子的情况棍长的总数首先要是4的倍数,才能进行。否则直接输出 “no”当前面前提满足以后,再满足3 根棍子拼好,就完工了。最后一根一定能拼好。解法就是DFS------->深度优先搜索。DFS的思路就是一个图沿着一条路走下去,当走不下去的时候就回溯到上一...转载 2018-05-28 10:34:21 · 236 阅读 · 0 评论 -
poj 1088 Joy OI1004(滑雪)
滑雪 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 73409 Accepted: 27141 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。M...原创 2018-07-25 07:15:21 · 290 阅读 · 0 评论 -
HDOJ 1312 (POJ 1979)
Problem Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjace...原创 2018-07-21 23:23:18 · 283 阅读 · 0 评论 -
HDOJ 1312 (POJ 1979) Red and Black
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 23956 Accepted Submission(s): 14495 Problem Description There is a rect...原创 2018-07-22 08:40:01 · 244 阅读 · 0 评论