摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2822给定起点和终点,问从起点到终点需要挖几次只有从# 到 .或者从. 到 . 才需要挖一次。#include #include #include using namespace std;const int max... 阅读全文
posted @ 2015-06-02 21:13 NowAndForever 阅读(180) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2645找出每个点到距离最近的车站的距离。直接bfs就好。 1 #include 2 #include 3 #include 4 using namespace std; 5 int n,m; 6 int ma... 阅读全文
posted @ 2015-06-02 21:04 NowAndForever 阅读(161) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1627给定 n 和 L 找出第n个范围在0-L之内的字符串,字符串要求没有相邻的子串是相同的。按照格式输出。这个题的关键在于判断字符串是否是符合要求的字符串.枚举字符串所有子串可能的长度,然后判断即可。#inclu... 阅读全文
posted @ 2015-06-02 20:16 NowAndForever 阅读(161) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1172这个题换一种想法,可以找出四位数中所有满足条件的数看是否只有一个. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include... 阅读全文
posted @ 2015-06-02 15:21 NowAndForever 阅读(339) 评论(0) 推荐(0) 编辑