随笔分类 -  DFS

摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define sc(x) scanf("%d",&(x)) 8 #define sc2(x,y) scanf("%d%d", &(x), &(y))... 阅读全文
posted @ 2015-04-10 18:59 PastLIFE 阅读(150) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define sc(x) scanf("%d",&(x)) 8 #define sc2(x,y) scanf("%d%d", &(x), &(y))... 阅读全文
posted @ 2015-04-10 18:39 PastLIFE 阅读(195) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #define sc(x) scanf("%d",&(x)) 8 #define sc2(x,y) scanf("%d%d", &(x), &(y))... 阅读全文
posted @ 2015-04-10 18:29 PastLIFE 阅读(288) 评论(0) 推荐(0)
摘要:1、打表问题 1 //1364495 2009-05-13 20:42:44 Time Limit Exceeded 2212 2000MS 232K 426 B C++ Wpl 2 3 //1364655 2009-05-13 21:03:44 Accepted 2212 0MS 204K 29... 阅读全文
posted @ 2015-04-09 16:28 PastLIFE 阅读(261) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #define M 21 5 #define sc(x) scanf("%d",&x) 6 #define pf(x) printf("%d\n",x) 7 #define PF(x) printf("%d ",x) 8 #de... 阅读全文
posted @ 2015-03-11 14:51 PastLIFE 阅读(148) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 char maze[8][8]; 7 int n, m, t; 8 int mx, my, X, Y; 9 int flag, tt;10 int Move[4][2]= {... 阅读全文
posted @ 2015-03-04 14:13 PastLIFE 阅读(136) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #define pf(x) printf("%d\n", x) 4 using namespace std; 5 const int MAX = 105; 6 char oil[MAX][MAX]; 7 int Move[8][2]= {{1,0... 阅读全文
posted @ 2015-03-03 19:34 PastLIFE 阅读(157) 评论(0) 推荐(0)
摘要:#include #include using namespace std;char chars[] = {'a', 'b', 'c'};char result[3];int flag[3] ; // 用于标记是否使用过int len;// 注意,为了打印,这个函数需要接受一个结果数组,来记录每次递... 阅读全文
posted @ 2014-10-11 13:02 PastLIFE 阅读(158) 评论(0) 推荐(0)
摘要:http://blog.sina.com.cn/s/blog_4d8721980100dxnv.html 转递归思想:取出数组中第一个元素放到最后,即a[1]与a[n]交换,然后递归求a[n-1]的全排列1)如果数组只有一个元素n=1,a={1} 则全排列就是{1}2)如果数组有两个元素n=2,a=... 阅读全文
posted @ 2014-10-10 07:11 PastLIFE 阅读(152) 评论(0) 推荐(0)