
dfs||bfs
-Dong
本博客转载或复制的内容只作为自己复习回顾用,无意触犯原出处。
展开
-
hdu 1044 Collect More Jewels(bfs+dfs)
题目链接:哆啦A梦传送门 参考链接:https://www.cnblogs.com/kuangbin/archive/2012/08/14/2637512.html题意:给一个迷宫图,让你在不超过时间L的情况下从起点走到终点,图中有些点是有宝藏的,经过这个点会得到相应的宝藏价值,'@'表示起点,'<'表示终点,'*'表示墙,'.'表示空地,‘A'~’J'表示宝藏;题解:我们先...原创 2019-01-15 22:55:06 · 373 阅读 · 0 评论 -
牛客网暑期ACM多校训练营(第七场)C Bit Compression (dfs暴力解决)
题目链接:https://www.nowcoder.com/acm/contest/145/C C、Bit Compression | 时间限制:2秒 | 内存限制:256MA binary string s of length N = 2n is given. You will perform the following operation n times :- Choose one...原创 2018-08-10 10:37:55 · 246 阅读 · 0 评论 -
第十四届华中科技大学程序设计竞赛-L—Fresh Air,bfs拓展,倒着bfs
题目描述It’s universally acknowledged that there’re innumerable trees in the campus of HUST. And you know that, trees have the special ability to refresh theair. If an area, which is surrounded by t...原创 2018-05-01 18:55:59 · 698 阅读 · 0 评论 -
hdu 4777 USACO ORZ dfs
题目链接:哆啦A梦传送门题意:给你n条边,用这n条边组成一个三角形,问:有多少中不同的可能性?题解:直接暴搜。参考博客:https://www.cnblogs.com/kuangbin/archive/2012/09/10/2679034.html#include<cstdio>#include<algorithm>#include<cstr...原创 2019-01-16 10:12:22 · 208 阅读 · 0 评论 -
hdu 4333 A very hard Aoshu problem (二进制枚举)
题目链接:哆啦A梦传送门题意:给你一串字符串,让你从中添加一个‘=’,任意个‘+’,使得满足等式。问:有多少中不同的方式?题解:我们可以二进制枚举,1表示此位置取‘+’,0表示不取。#include<cstdio>#include<algorithm>#include<cstring>using namespace std;char o...原创 2019-01-16 11:25:35 · 263 阅读 · 0 评论 -
多校4 hdu 6341 Problem J. Let Sudoku Rotate (dfs)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6341题意:给你16*16的数独,分为16个4*4的小块,现在有某些块被逆时针旋转了多次,现在要你用最少旋转次数把数独还原好。题解:dfs,每块最多旋转3次,那么我们就直接暴力搜就好了。 代码:#include<cstdio>#include<algorithm...原创 2019-02-21 22:43:12 · 172 阅读 · 0 评论