码迷,mamicode.com
首页 >  
搜索关键字:线段树    ( 9365个结果
杭电 1754 I Hate It(线段树求最值)
http://acm.hdu.edu.cn/showproblem.php?pid=1754 I Hate It Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 38601    Accepted Submission(s): ...
分类:其他好文   时间:2014-08-12 22:16:24    阅读次数:357
hdu1828 Picture(线段树+离散化+扫描线)两种方法
C - Picture Time Limit:2000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Description A number of rectangular posters, photographs and other pictures of ...
分类:其他好文   时间:2014-08-12 22:08:14    阅读次数:460
POJ训练计划1177_Picture(扫描线/线段树+离散)
解题报告 题意: 求矩形周长和。 思路: 左扫上扫,扫过了。 #include #include #include #include #include using namespace std; struct Seg { int lx,rx,ly,ry,h,v; friend bool operator < (Seg a,Seg b) { ...
分类:其他好文   时间:2014-08-12 22:06:34    阅读次数:243
线段树求解Minimum Inversion Number
题:Minimum Inversion Number 题意:给出一个序列,如果某一项比它前面的项小(本来应该是一次增大的),这就是一组逆序项,如例:1 3 6 9 0 8 5 7 4 2就有22组逆序项。(1,0)(3,0)(3,2)(6,0)(6,5)(6,4)(9,0)(9,8)(9,5)。。。现在你可以将x1移至最后,再将x2移至最后,直到把xn-1移到最后(xn移到最后无意义),在这过程...
分类:其他好文   时间:2014-08-12 19:10:24    阅读次数:264
POJ 2528 Mayor's posters(线段树+离散化)
题目链接:Mayor's posters 题意:按顺序往墙上贴海报,可以重叠,问最后可以看到多少海报。(被覆盖的海报是看不到的) 注意: 因为数据比较大,所以不离散化,肯定爆内存。 还有就是,不能只是单纯的离散化,还要处理好点的边界 举个例子 4 2  10. 2  8 3  6 6  8 8  10 离散化后 2 3 6 8 10 1 2 3 4 5 覆盖掉了  ...
分类:其他好文   时间:2014-08-12 19:05:54    阅读次数:228
POJ 3277 City Horizon(线段树+扫描线+离散化)
题目地址:POJ 3277 水题。。稍微处理一下然后用求面积并的方法求即可。 代码如下: #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define lson l, mid,...
分类:其他好文   时间:2014-08-12 19:03:54    阅读次数:310
hdu1255--覆盖的面积(线段树+离散化+扫描线)
E - 覆盖的面积 Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description 给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.    Input 输入数据的第一行是一个...
分类:其他好文   时间:2014-08-12 19:01:42    阅读次数:290
HDU 3874 Necklace (线段树单点更新+区间查询+离线操作)
Problem Description Mery has a beautiful necklace. The necklace is made up of N magic balls. Each ball has a beautiful value. The balls with the same beautiful value look the same, so if two or more ...
分类:其他好文   时间:2014-08-12 17:29:44    阅读次数:253
HDU1255_覆盖的面积(扫描线/线段树+离散)
解题报告 题目传送门 题意: 求面积交。 思路: 不会呀。 只知道线段树应该维护覆盖数大于2的线段长度。 不会更新,看了别人写的理解的,太菜了。 用sum1和sum2分别来表示覆盖数为1的区间长度和覆盖数为2的区间长度。 更新时即要更新sum1也要更新sum2; 区间如果被覆盖 sum1为实际区间长度,如果覆盖一次,sum2为左右子树的sum1和,覆盖两次就为实际区间长度。 ...
分类:其他好文   时间:2014-08-12 17:11:04    阅读次数:205
CF339D Xenia and Bit Operations线段树
把区间和改成,第一层|,第二层 ^。每次给出一个x,y把 第x个变成y ,输出 sum[1];#include #include #include #include #include #include #include #include #include #include #include #inc...
分类:其他好文   时间:2014-08-12 16:22:44    阅读次数:190
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!