随笔分类 -  搜索

吝啬的国度 简单的图搜索
摘要:1 #include <stdio.h> 2 #include <string.h> 3 #include <math.h> 4 #include <stdlib.h> 5 int pre[100005]; 6 typedef struct edge 7 { 8 int v; 9 struct ed 阅读全文

posted @ 2016-05-04 11:26 青春的梦想付诸行动 阅读(148) 评论(0) 推荐(0)

字母有重复全排列
摘要:1 #include <stdio.h> 2 3 int n; 4 char s[15]; 5 char ss[15]={'A','B','C','D','E','F','G','H','I','J'}; 6 7 void dfs(int cur) //cur表示第几个位置 8 { 9 if(cur 阅读全文

posted @ 2016-04-15 15:57 青春的梦想付诸行动 阅读(365) 评论(0) 推荐(0)

zb的生日
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cstring> 5 #include <cmath> 6 using namespace std; 7 int w[30],vis[30]; / 阅读全文

posted @ 2016-04-14 19:58 青春的梦想付诸行动 阅读(150) 评论(0) 推荐(0)

最小步数NYOJ bfs
摘要:1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 using namespace std; 5 6 int d[9][9]; //标记此点是否访问并记录距离 7 int maze[9][9]={ 8 1,1,1,1,1,1,1 阅读全文

posted @ 2016-04-13 18:10 青春的梦想付诸行动 阅读(209) 评论(0) 推荐(0)

组合数
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <cmath> 5 #include <cstring> 6 using namespace std; 7 8 int s[11],n,r,vis[ 阅读全文

posted @ 2016-04-13 10:45 青春的梦想付诸行动 阅读(130) 评论(0) 推荐(0)

素数环
摘要:1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <cmath> 5 #include <cstring> 6 using namespace std; 7 8 int prime[13]={2,3 阅读全文

posted @ 2016-04-12 20:12 青春的梦想付诸行动 阅读(182) 评论(0) 推荐(0)

数独
摘要:1 #include <cstdio> 2 #include <algorithm> 3 #include <cstring> 4 #include <iostream> 5 using namespace std; 6 7 int s[9][9];//数独 8 9 bool ans(int x,i 阅读全文

posted @ 2016-04-12 10:41 青春的梦想付诸行动 阅读(172) 评论(0) 推荐(0)

nyoj迷宫寻宝(一)
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 #include <queue> 6 7 using namespace std; 8 struct node{ 9 int 阅读全文

posted @ 2016-04-11 21:20 青春的梦想付诸行动 阅读(375) 评论(0) 推荐(0)

三个水杯
摘要:1 #include <cstdio> 2 #include <cstring> 3 #include <queue> 4 5 using namespace std; 6 struct node { 7 int wat[3]; //记录中间过程状态 8 int step;//最小倒水次数。 9 } 阅读全文

posted @ 2016-04-11 11:18 青春的梦想付诸行动 阅读(120) 评论(0) 推荐(0)

部分和
摘要:1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cmath> 5 #include <cstring> 6 7 using namespace std; 8 int n,k,c,sum,s[20 阅读全文

posted @ 2016-04-10 21:51 青春的梦想付诸行动 阅读(154) 评论(0) 推荐(0)

导航