会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Apale
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
下一页
2018年7月9日
主席树模板(POJ2104)
摘要: 离散化: 对数组排完序后用unique去重,unique返回的是去重后的数组的末地址,减去第一个元素的地址就能得到去重后的数组大小,用lower_bound查找原数字在排序去重后的序列中的位序,用位序代替数字完成离散化。#include#includ...
阅读全文
posted @ 2018-07-09 13:48 Apale
阅读(114)
评论(0)
推荐(0)
2018年7月6日
POJ3667(线段树区间合并)
摘要: #include#include#includeusing namespace std;#define lson l,m,rt>1); ms[rt>1; } lazy[rt] = -1; }}void ...
阅读全文
posted @ 2018-07-06 23:16 Apale
阅读(115)
评论(0)
推荐(0)
2018年6月22日
堆排序
摘要: 今天课上学的堆排序。#includeusing namespace std;void HeapAdjust(int a[],int i,int len){ if(i>len/2)//大于len/2的是叶子结点,不用调整 return ;...
阅读全文
posted @ 2018-06-22 22:18 Apale
阅读(127)
评论(0)
推荐(0)
2018年5月16日
线段树模板(新)
摘要: #define lson l,m,rt>1; build(lson); build(rson); pushup(rt);}void pushdown(int l,int r,int rt){ if(lazy[rt]) { ...
阅读全文
posted @ 2018-05-16 17:19 Apale
阅读(100)
评论(0)
推荐(0)
2018年5月14日
根据二叉树的先序遍历和中序遍历序列建树
摘要: 思路:先序序列的每个元素代表一个根节点,这个元素在中序序列中左边的部分就是它的左子树,右边部分就是它的右子树代码如下(求树深度的部分是多余的):#includeusing namespace std;int N;string xian,zhong;struc...
阅读全文
posted @ 2018-05-14 16:29 Apale
阅读(769)
评论(0)
推荐(0)
2018年5月10日
zoj1610- Count the Colors(线段树区间染色覆盖问题)
摘要: Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones. Your task ...
阅读全文
posted @ 2018-05-10 11:10 Apale
阅读(138)
评论(0)
推荐(0)
2018年5月7日
小小学习计划∠( ᐛ 」∠)_
摘要: 昨天华工省赛1题打铁QAQ,自己那部分的题也没a出来,有点小难受。这学期的比赛基本告一段落了,下半学期要先把绩点补一补,先不挂科。然后要继续拓展知识的宽度,在慢慢拓展宽度的情况下选一个方面强化一下深度。 训练了这么多次,感觉RMQ问题还是挺常见的,那就从RM...
阅读全文
posted @ 2018-05-07 00:43 Apale
阅读(76)
评论(0)
推荐(0)
2018年4月18日
AC自动机(hdu2222)
摘要: 写的链式的,数组实现还不会。 链式如果delete就会花费很多时间,不delete就花很多内存。 就先这样吧……#includeusing namespace std;string str,pri;int T,n;struct Node{ int cn...
阅读全文
posted @ 2018-04-18 22:37 Apale
阅读(93)
评论(0)
推荐(0)
2018年4月11日
KMP模板
摘要: char t[1000005],p[10005];int Next[10005];void getNext(){ int j=0,k=-1; int len = strlen(p); Next[0] = -1; while(j<len...
阅读全文
posted @ 2018-04-11 20:31 Apale
阅读(84)
评论(0)
推荐(0)
ZOJ4020 Traffic Light (bfs)
摘要: 好久没打搜索了。。一个bfs哇了一晚上╭(╯^╰)╮ 题目几乎是一个裸的bfs,只不过每个点有两种状态,每走一步状态就反转,所以判下一个点的去过没有的时候要判断与当前状态相反的点。 代码:#include using namespace std;bool t...
阅读全文
posted @ 2018-04-11 16:31 Apale
阅读(120)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
下一页
公告
点击右上角即可分享