
dfs
文章平均质量分 74
别动我的白羊毛
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
dfs(hdu1241)
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th原创 2017-08-16 18:37:46 · 239 阅读 · 0 评论 -
Import Spaghetti
https://odzkskevi.qnssl.com/da9adfb686ef541a14cec9856721130a?v=1507986800 I题 #include #include #include #include #include #define inf 999999999 #include #define N 550 using namespace std; struct原创 2017-10-15 20:02:30 · 570 阅读 · 0 评论 -
Gym - 101617H(Security Badges)
题意:给你n、m、k,表示房间数量、门数量和人数,给s、d表示从s到d,给m行a、b、min、max,表示从a房间到b,编号在min和max之间的人可以通过,问有几人可以从s到d。 思路:最后到达d的人,编号范围一定是包含在前面的路径里面的。离散化min和max,遍历并用dfs判断能否从s到d,可以就加到sum里面去。 #include #include #include #include #原创 2017-12-08 16:40:54 · 740 阅读 · 0 评论 -
hdu 1010 Tempter of the Bone(dfs+剪枝)
题目链接:hdu 1010 Tempter of the Bone(dfs+剪枝) 题意:狗狗从S出发,要在正好t秒的时候到达D,每一块地只能走一次,X代表墙不能走,问能否到达 思路:深搜,但是需要剪枝,每走一步,判断能否在剩下的时间中不考虑墙通过最短的路到达出口,若不能直接返回。 #include<cstdio> #include<cstring> #incl...原创 2018-08-03 16:58:22 · 239 阅读 · 0 评论 -
hdu 1560 DNA sequence(迭代加深)
题目链接:hdu 1560 DNA sequence 题意:构造一个最短的字符串,使得给出的n个字符串(只包含ACGT)都是这个字符串的字串(可以不连续),输出字符串的长度。 思路:最短为n个字符串中最长串的长度,最长为n个字符串长度之和,在这个范围内dfs。具体dfs内容见代码注释 #include<cstdio> #include<cstring> #inc...原创 2018-08-03 17:41:35 · 167 阅读 · 0 评论 -
poj 2362 Square
题目链接:poj 2362 Square Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The first line of input contains N, the number of test cases. Each test...原创 2018-08-03 21:17:20 · 242 阅读 · 0 评论 -
2018 Multi-University Training Contest 5 B Beautiful Now(hdu 6351)
题目链接:hdu 6351 Beautiful Now Sample Input 5 12 1 213 2 998244353 1 998244353 2 998244353 3 Sample Output 12 21 123 321 298944353 998544323 238944359 998544332 233944859 998544332 题意:给你数字n和k,可以...原创 2018-08-06 18:45:43 · 221 阅读 · 0 评论 -
Gym - 101879C C. Promenade by the lake(欧拉回路,dfs)
题目链接:Gym - 101879C C. Promenade by the lake The city of Porto will host the ICPC World Finals in 2019. One of the secret touristic spots in the city is the so-called "lake of the thousand bridges". M...原创 2018-09-27 18:51:54 · 423 阅读 · 0 评论