2012年8月11日

hdoj 1010 Tempter of the Bone

摘要: 1 #include <stdio.h> 2 #include <iostream> 3 #include <math.h> 4 5 using namespace std; 6 7 int n, m, t, di, dj, success; 8 char maze[10][10]; 9 10 void dfs(int i, int j, int cnt)11 {12 int temp;13 if (i == di && j == dj && cnt == t)14 {15 success = 1;16 return;17 . 阅读全文

posted @ 2012-08-11 18:25 Xor<>OR 阅读(124) 评论(0) 推荐(0)

hdoj 2066 一个人的旅行

摘要: 最短路问题,把0(小草所在的)城市与相邻城市设置为0,然后就是求出每想去城市的最短路径,从每个最短路径中取出最小值 1 #include <stdio.h> 2 #define min(a, b) a < b ? a : b 3 #define inf 0x7FFFFFFF 4 #define M 1001 5 6 int map[M][M]; 7 int dist[M]; 8 int visit[M]; 9 10 int t, s, d, k;11 12 int mdist(int res, int des) //最短路函数13 {14 int i = 0;15 for ( 阅读全文

posted @ 2012-08-11 12:43 Xor<>OR 阅读(230) 评论(0) 推荐(0)

导航