2013年8月9日

hdu2612 Find a way BFS

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2612思路:裸的BFS,对于Y,M分别进行BFS,求出其分别到达各个点的最小时间;然后对于@的点,将两者的最小时间相加即为到达此点的总时间,遍历所有@点,更新结果即可;代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define MAX 0x7f7f7f7f 7 using namespace std; 8 int n,m; 9 int startY_x,startY_y; 10 int startM_x... 阅读全文

posted @ 2013-08-09 19:56 GyyZyp 阅读(171) 评论(0) 推荐(0) 编辑

POJ1012-Joseph数学

摘要: POJ1012-Joseph数学 阅读全文

posted @ 2013-08-09 18:06 GyyZyp 阅读(226) 评论(0) 推荐(0) 编辑

hdu 题目分类

摘要: 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 1202 1205 1209 1212(大数取模) 1216(链表)1218 1219 1225 1228 阅读全文

posted @ 2013-08-09 16:51 GyyZyp 阅读(143) 评论(0) 推荐(0) 编辑

hdu2717Catch That Cow 简单BFS

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2717刚开始思路错了,用的DP,一直WA,后来才发现是搜索,还是简单的BFS,顿时。。。。思路:BFS 三个方向即可;代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define MAX 100010 9 using namespace std;10 int n,k;11 int cur,next;12 int step[MAX];13 queueq;14 void bfs()1. 阅读全文

posted @ 2013-08-09 16:04 GyyZyp 阅读(397) 评论(0) 推荐(0) 编辑

导航