随笔分类 -  搜索

摘要:题目:https://vjudge.net/problem/POJ-3126#author=541607120101 简单bfs,但我用了很笨比的做法。。把每一位数都保存下来然后逐位改值检查并加入队列,直到找到所求值,具体见代码。 1 #include <stdio.h> 2 #include <s 阅读全文
posted @ 2020-02-14 15:30 yanying 阅读(136) 评论(0) 推荐(0)
摘要:题目:https://vjudge.net/problem/HDU-1241#author=AlwaysInsistOn 分析:简单bfs,输入后对每一个找到的'@’进行广搜并计数,将广搜找到的'@'改为'*',最后输出即可。 代码: 1 #include <stdio.h> 2 #include 阅读全文
posted @ 2020-02-13 16:47 yanying 阅读(122) 评论(0) 推荐(0)
摘要:题目:https://vjudge.net/problem/HDU-2612#author=zhang95986 分析:经典bfs,具体见代码。 #include <stdio.h> #include <string.h> int n,m; char c[201][201]; int f[201][ 阅读全文
posted @ 2020-02-13 15:52 yanying 阅读(170) 评论(0) 推荐(0)