随笔分类 -  02.搜索 - (1)BFS

摘要:题目链接:http://codeforces.com/problemset/problem/677/D 题意: 有 n×m 的网格,每个网格上有一个棋子,棋子种类为 t[i][j],棋子的种类数为 p。 现在出发点为 (1,1),必须按照种类 1p 进行 阅读全文
posted @ 2019-03-02 17:20 Dilthey 阅读(244) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述 给定一张N个点M条边的有向无环图,分别统计从每个点出发能够到达的点的数量。N,M≤30000。 输入格式 第一行两个整数N,M,接下来M行每行两个整数x,y,表示从x到y的一条有向边。 输出格式 共N行,表示每个点能够到达的点的数量。 样例输入 样例输出 题解: 首先,如果用 阅读全文
posted @ 2019-01-08 23:28 Dilthey 阅读(513) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612 Problem DescriptionPass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. 阅读全文
posted @ 2018-12-10 09:17 Dilthey 阅读(168) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3085 Problem DescriptionLast night, little erriyue had a horrible nightmare. He dreamed that he and his 阅读全文
posted @ 2018-11-27 23:37 Dilthey 阅读(212) 评论(0) 推荐(0) 编辑
摘要:题目链接:传送门 描述 Ha'nyu是来自异世界的魔女,她在漫无目的地四处漂流的时候,遇到了善良的少女Rika,从而被收留在地球上。Rika的家里有一辆飞行车。有一天飞行车的电路板突然出现了故障,导致无法启动。电路板的整体结构是一个R行C列的网格(R,C≤500),如右图所示。每个格点都是电线的接点 阅读全文
posted @ 2018-11-20 20:12 Dilthey 阅读(745) 评论(0) 推荐(0) 编辑
摘要:题目链接: http://poj.org/problem?id=2513 http://bailian.openjudge.cn/practice/2513?lang=en_US Time Limit: 5000MS Memory Limit: 128000K Description You are 阅读全文
posted @ 2018-11-16 18:38 Dilthey 阅读(348) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241 题意: 求某块平面上,连通块的数量。一个油田格子若周围八个方向也有一个油田格子,则认为两者相连通。 AC代码: 阅读全文
posted @ 2018-10-31 16:44 Dilthey 阅读(161) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3984 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0 阅读全文
posted @ 2018-10-31 15:40 Dilthey 阅读(458) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://cn.vjudge.net/problem/UVA-11624 题意: 给出一个 n×m 的矩阵,上面有的格子能走,有的格子是墙不能走。 有若干个点是火源,火每分钟都往上下左右蔓延一格(不能越墙)。又给出一个点是Joe的出发点,他只要能在不碰到火的前提下走 阅读全文
posted @ 2018-10-31 00:24 Dilthey 阅读(341) 评论(0) 推荐(0) 编辑
摘要:Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is con 阅读全文
posted @ 2018-10-30 22:26 Dilthey 阅读(2377) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3414 Time Limit: 1000MS Memory Limit: 65536K Description You are given two pots, having the volume of A and B liters re 阅读全文
posted @ 2018-10-29 21:15 Dilthey 阅读(357) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3126 题意: 给定两个四位素数 a,b,要求把 a 变换到 b。变换的过程每次只能改动一个数,要保证每次变换出来的数都是一个没有前导零的四位素数。 要求每步得到的素数都不能重复,求从 ab 最少需要变换多少步 阅读全文
posted @ 2018-10-28 23:44 Dilthey 阅读(152) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=1426 Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation con 阅读全文
posted @ 2018-09-23 20:47 Dilthey 阅读(610) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://poj.org/problem?id=3278 Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He 阅读全文
posted @ 2018-09-19 23:07 Dilthey 阅读(444) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3781 Time Limit: 2 Seconds Memory Limit: 65536 KB Leo has a grid with N rows and M c 阅读全文
posted @ 2018-04-23 22:18 Dilthey 阅读(315) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=2444 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Des 阅读全文
posted @ 2017-10-12 23:08 Dilthey 阅读(279) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1495 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Descripti 阅读全文
posted @ 2017-08-13 10:23 Dilthey 阅读(268) 评论(0) 推荐(0) 编辑
摘要:Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be fille 阅读全文
posted @ 2017-08-12 10:16 Dilthey 阅读(415) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://hihocoder.com/problemset/problem/1322 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一个包含 N 个顶点 M 条边的无向图 G , 阅读全文
posted @ 2017-08-02 00:04 Dilthey 阅读(262) 评论(0) 推荐(0) 编辑
摘要:1 #include<cstdio> 2 #include<queue> 3 #include<cstring> 4 using namespace std; 5 int n,m,mv;char map[103][103];bool vis[103][103]; 6 struct type{ 7 i 阅读全文
posted @ 2017-04-05 23:06 Dilthey 阅读(172) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示