上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 26 下一页
摘要: 题意:给你N个长方体的左下角和右上角坐标,问你空间中有多少体积是被大于两个不同的立方体覆盖的。x,y~10^6 z~500考虑到给的z比较小,所以可以直接枚举z,然后跑二维的扫描线就好。关于处理被不同的线段覆盖三次的问题,可以维护四个信息,cnt,once,twice,more,然后相互推出结果就好... 阅读全文
posted @ 2014-08-19 20:01 acm_roll 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 反向标记是错的,要对矩形进行拆分#include #include #include #include typedef long long LL;using namespace std;#define lson rt seg;void pushup(int rt, int l, int r) { ... 阅读全文
posted @ 2014-08-17 13:53 acm_roll 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 题意:给你一些矩形的左上角点的坐标和右下角点的坐标,求周长并最显而易见的思路就是对于x轴和y轴做两次扫描线,对于负数的坐标进行离散化。每次增加的值是线段变化量的绝对值。具体写法和求面积并的差不多。#include #include #include #include using namespace ... 阅读全文
posted @ 2014-08-17 12:55 acm_roll 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 题意:给出一些矩形的最上角坐标和右下角坐标,求这些矩形的面积并。NotOnlySuccess 线段树专辑中扫描线模板题,弱智的我对着大大的代码看了一下午才搞懂。 具体见思路见注释=。=#include #include #include #include #define lson rt dy;vec... 阅读全文
posted @ 2014-08-16 20:00 acm_roll 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 线段树大杂烩~ 各种操作都有,细心点不难1A#include #include #include #include using namespace std;#define lson rt> 1; int Llen = mid - l + 1, Rlen = r - mid; for (int i =... 阅读全文
posted @ 2014-08-15 16:08 acm_roll 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 简单的区间合并线段树,不过要特殊讨论一下当前车是停车场里面唯一一辆车的情况还有车停在边界的情况#include #include #include #include using namespace std;#define lson rt> 1; int Llen = mid - l + 1, Rle... 阅读全文
posted @ 2014-08-15 14:42 acm_roll 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 虐心线段树 感觉写的有点挫#include #include #include #include #include #include #include #include #include #include #include using namespace std;#define lson rt> 1... 阅读全文
posted @ 2014-08-15 08:51 acm_roll 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 水题,一维的DP,表示还剩哪些atom的时候能获得的最大能量#include #include #include #include #include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2014-08-12 15:52 acm_roll 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 一开始能想到的状态就只有位压两行和当前行的行号,这样无论是空间和时间都是无法接受的。但是因为炮兵的攻击范围比较大,而且又有地形限制,每一行的状态其实不多了,打表看了一下不超过80种,离散化一下就可以随意DP了。据说题目也可以抽象成二分图最大匹配来搞?感觉复杂度有点高#include #include... 阅读全文
posted @ 2014-08-12 15:13 acm_roll 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 三进制状压。调了一整天,一开始用记忆化搜索一直超时,后来改成了递推,代码能力真是弱。。后来瓜神提供了一个思路,如果建立一个超级源点然后用记忆化搜索的话,应该可以过。。。。#include #include #include #include #include #include #include #i... 阅读全文
posted @ 2014-08-12 13:43 acm_roll 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 26 下一页