上一页 1 2 3 4 5 6 7 8 9 ··· 42 下一页
摘要: bfs思路:三维标记状态 && 处理好 - | 和时刻的关系即可 1 /* 2 bfs 3 思路:三维标记状态 && 处理好 - | 和时刻的关系即可 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 using namespace std; 16 typedef long long int64; 17 //typedef __int6... 阅读全文
posted @ 2013-10-30 18:41 xxx0624 阅读(501) 评论(0) 推荐(0) 编辑
摘要: bfs+状态压缩思路:用2进制表示每个钥匙是否已经被找到。、 1 /* 2 bfs+状态压缩 3 思路:用2进制表示每个钥匙是否已经被找到。 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 using namespace std; 16 typedef long long int64; 17 //typedef __int64 int... 阅读全文
posted @ 2013-10-29 21:37 xxx0624 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 题意:从起点到终点有几条特殊路径。特殊路径指的是:对于任意两条路径,他们的与起点相连的点是不同的点 && 与终点的相连的点是不同的点。 1 /* 2 题意:从起点到终点有几条特殊路径。 3 特殊路径指的是:对于任意两条路径,他们的与起点相连的点是不同的点 && 与终点的相连的点是不同的点。 4 思路: 5 把起点和后继节点的流量设置为1,同理对终点处理 6 这样在寻找最大流的增广路径时就会消除一条。。 7 */ 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 us. 阅读全文
posted @ 2013-10-20 19:46 xxx0624 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 简单的BFS题意:多起点多终点 1 /* 2 简单的BFS 3 题意:多起点多终点 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include10 using namespace std;11 12 const int maxn = 184;13 const int inf = 0x3f3f3f3f;14 15 int dis[ maxn ][ maxn ];16 char mat[ maxn ][ maxn ];17 const int dx[]={0,0,1,-1};18 const int dy[]={1,-1,0,0};1.. 阅读全文
posted @ 2013-10-20 17:25 xxx0624 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Linux: more已实现:more filename , quit不需要回车未实现:command | more 重定向 ,显示百分比 Waiting。。。 1 /* 2 Linux: more 3 已实现:more filename , quit不需要回车 4 未实现:command | more 重定向 ,显示百分比 5 Waiting。。。 6 */ 7 #include 8 #define PAGELEN 24 9 #define LINELEN 51210 void do_more( FILE * );11 int see_more();12 int main( int ac,. 阅读全文
posted @ 2013-10-09 21:05 xxx0624 阅读(498) 评论(0) 推荐(1) 编辑
摘要: 题意:给定一个N*N的矩阵, 然后在这个矩阵的每个格子在任意时间会出现一个鼹鼠,这个出现 出现鼹鼠的时间是输出信息所确定的. 现在你手里有一把锤子能够去锤这些鼹鼠. 你能 够移动锤子,移动的两点之间的距离不能超过d,且中心在这条路径上的鼹鼠到都要受到 打击. 每个鼹鼠出现的时间值维持一秒钟. 现在问在一次游戏中最多打到多少鼹鼠 1 /* 2 dp 3 题意:给定一个N*N的矩阵, 然后在这个矩阵的每个格子在任意时间会出现一个鼹鼠,这个出现 4 出现鼹鼠的时间是输出信息所确定的. 现在你手里有一把锤子能够去锤这些鼹鼠. 你能 5 够移动锤子,移动的两点之间的距离不... 阅读全文
posted @ 2013-10-06 14:48 xxx0624 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 先预处理出有多少个任务即可 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 1005; 8 const int maxm = 1000005; 9 struct Edge{10 int u,v,next;11 }edge[ maxm ];12 int cnt ,head[ maxn ];13 void init(){14 cnt = 0;15 memset( head,-1,sizeof( head ) );16 }17 vo... 阅读全文
posted @ 2013-10-04 17:25 xxx0624 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 简单题 1 /* 2 简单的bfs 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std; 15 typedef long long int64; 16 //typedef __int64 int64; 17 typedef pair PII; 18 #define MP(a,b) make_pair((a),(b)) 19 const int i... 阅读全文
posted @ 2013-10-03 21:34 xxx0624 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 题意简单,中文题目方法:对于一个数 从左往右找相同的数 ,有就改变靠右的,同时把该数的右边全置0注意!!!!n 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 using namespace std; 15 typedef long long int64; 16 //typedef __int64 int64; 17 typedef pair PII; 18 #define MP(a,b) make_pair((a),(b... 阅读全文
posted @ 2013-10-03 19:53 xxx0624 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题意简单:去掉最小生成树的某一条边并补上一条,求MaxVal思路:贪心(借鉴Yamidie的思路。。。)分别求出最小生成树和次最小生成树,再在这两棵树上求最小生成树 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int maxn = 1015; 8 const int maxm = maxn*maxn; 9 const int inf1 = 0x3f3f3f3f; 10 const double inf2 = 9999999999; 11 12 st... 阅读全文
posted @ 2013-09-25 00:09 xxx0624 阅读(301) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 42 下一页