![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 197 阅读 · 0 评论 -
Import Spaghetti
https://odzkskevi.qnssl.com/da9adfb686ef541a14cec9856721130a?v=1507986800I题#include#include#include#include#include#define inf 999999999#include#define N 550using namespace std;struct原创 2017-10-15 20:02:30 · 505 阅读 · 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 · 669 阅读 · 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 · 186 阅读 · 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 · 133 阅读 · 0 评论 -
poj 2362 Square
题目链接:poj 2362 SquareGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square?InputThe first line of input contains N, the number of test cases. Each test...原创 2018-08-03 21:17:20 · 201 阅读 · 0 评论 -
2018 Multi-University Training Contest 5 B Beautiful Now(hdu 6351)
题目链接:hdu 6351 Beautiful NowSample Input512 1213 2998244353 1998244353 2998244353 3 Sample Output12 21123 321298944353 998544323238944359 998544332233944859 998544332题意:给你数字n和k,可以...原创 2018-08-06 18:45:43 · 161 阅读 · 0 评论 -
Gym - 101879C C. Promenade by the lake(欧拉回路,dfs)
题目链接:Gym - 101879C C. Promenade by the lakeThe 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 · 362 阅读 · 0 评论