上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 99 下一页

2011年5月8日

Catch That Cow

摘要: 这道题wa了首先是RE,因为数组下标没有有负的,其次是wa,wa了好几次,我就耐闷了,原来题目要求我输出最小的时间,还有当N>M时。。 #include<iostream>#include<string.h>#include<queue>using namespace std;int N,M,visit[1000010],dp[1000010];const int inf=0x7fffffff;i... 阅读全文

posted @ 2011-05-08 21:04 more think, more gains 阅读(216) 评论(0) 推荐(0) 编辑

2011年5月7日

A strange lift

摘要: 广搜: 哈哈。我用了stl..偷懒啦。。懒得写队列。。 #include<stdio.h>#include<string.h>#include<stdlib.h>#include<deque>#include<algorithm>using namespace std;deque<int>q;int floor,N,M,A[300];int mark[300];int dp[300];int ma... 阅读全文

posted @ 2011-05-07 22:15 more think, more gains 阅读(130) 评论(0) 推荐(0) 编辑

deque stl

摘要: STL deque 说明 #include <deque>deque容器类与vector类似,支持随机访问和快速插入删除,它在容器中某一位置上的操作所花费的是线性时间。与vector不同的是,deque还支持从开始端插入数据:push_front()。 构造: deque<Elem> c 创建一个空的deque deque<Elem> c1(c2) 复制一个deque。 deque<Elem> c... 阅读全文

posted @ 2011-05-07 21:52 more think, more gains 阅读(226) 评论(0) 推荐(0) 编辑

优先队列的学习

摘要: ADT 最大优先队列的抽象数据类型描述抽象数据类型 MaxPriorityQueue{ 实例 有限的元素集合,每个元素都有一个优先权 操作 Create ( ):创建一个空的优先队列 Size ( ):返回队列中的元素数目 Max ( ):返回具有最大优先权的元素 I n s e rt (x):将x插入队列 DeleteMax (x):从队列中删除具有最大优先权的元素,并将该元素返回至x } 优先... 阅读全文

posted @ 2011-05-07 17:52 more think, more gains 阅读(326) 评论(0) 推荐(0) 编辑

stl 中的栈的学习

摘要: TL 中栈的使用方法(stack) 基本操作: push(x) 将x加入栈中,即入栈操作 pop() 出栈操作(删除栈顶),只是出栈,没有返回值 top() 返回第一个元素(栈顶元素) size() 返回栈中的元素个数 empty() 当栈为空时,返回 true 使用方法和队列基本一样。 头文件 #include<stack> 定义方法: stack<int>s1;//入栈元素为 int 型 st... 阅读全文

posted @ 2011-05-07 17:21 more think, more gains 阅读(271) 评论(0) 推荐(0) 编辑

上一页 1 ··· 63 64 65 66 67 68 69 70 71 ··· 99 下一页

导航