该文被密码保护。 阅读全文
posted @ 2017-12-11 18:59 啊宸 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 精确覆盖问题是指对于给定的一个由0-1组成的矩阵,是否能找到一个行的集合,使得集合中每一列都恰好包含一个1。 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cst 阅读全文
posted @ 2017-12-11 07:30 啊宸 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 将边按a排序,一条条加入,若当前的x,y未联通则直接加入这条边, 否则看当前边的b是否小于x,y,路径上最大的b,小于则拆掉该边,加入当前边。 显然可以用lct维护,splay维护b的最大值 把边拆成点权为b的点,点则是点权为0 Cut时找到改点,splay到根,切掉左右儿子 Link时加入新点,把 阅读全文
posted @ 2017-12-11 07:28 啊宸 阅读(187) 评论(0) 推荐(0) 编辑
摘要: bzoj2049: [Sdoi2008]Cave 洞穴探测 给n个点,每次连接两个点或切断一条边,保证是树结构,多次询问两个点是否联通 Lct裸题 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cs 阅读全文
posted @ 2017-12-11 07:26 啊宸 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 树上的带修莫队模板 分块用刚才的王室联邦分快法 然后套带修莫队模板 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> 阅读全文
posted @ 2017-12-11 07:25 啊宸 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 给定一棵树,要求将这棵树分成一些块,使每块大小在[B,3B]之间 首先任选一点开始深搜 维护一个栈 每个点退出递归时压栈 自下至上进行合并 如果某棵子树深搜完之后栈内元素数>=b 就把当前的栈内元素合并为一个块 但是这种方法存在一个问题 就是如果某棵子树深搜之后不到b 去深搜下一个子树 可能在下一个 阅读全文
posted @ 2017-12-11 07:24 啊宸 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 块状链表模板题 然而我de了一整天bug,难受 rmemcpy常数小,大数据相比for大概有0.5s左右的差别 答案绝对不要一个一个地printf啊!t到死啊! memcpy存下来然后puts,直接从4.8s到0.9s啊啊 哭 //Achen #include<algorithm> #include 阅读全文
posted @ 2017-12-11 07:20 啊宸 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 三维坐标系中,每次操作增加一个点或者询问一个区域内点的个数。 Kd-tree裸题(cdq套cdq裸题) 模仿treap在Kd-tree中插入节点,一定时间后重建整颗kd_tree //Achen #include<algorithm> #include<iostream> #include<cstr 阅读全文
posted @ 2017-12-11 07:18 啊宸 阅读(190) 评论(0) 推荐(0) 编辑
摘要: //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> #include<queue> #include<ctime> # 阅读全文
posted @ 2017-12-11 07:16 啊宸 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 不旋转,基于split和merge操作的treap 又是三个模板 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> 阅读全文
posted @ 2017-12-11 07:14 啊宸 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 不平衡时暴力重构子树,可以说很少写且跑得很快 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> #include<q 阅读全文
posted @ 2017-12-11 07:12 啊宸 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 一道模板题。 然而和一维的差不多。 //Achen #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<vector> #include<queue> 阅读全文
posted @ 2017-12-11 07:09 啊宸 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 老张让弄专题,分到了数据结构,于是愉快地打了一周数据结构。 觉得还是要水一水bzoj,然后随便打开了一道,竟然是后缀数组模板。。 这周没写博客呀。。现在去补。。 //Achen #include<algorithm> #include<iostream> #include<cstring> #inc 阅读全文
posted @ 2017-12-11 07:06 啊宸 阅读(124) 评论(0) 推荐(0) 编辑