码迷,mamicode.com
首页 >  
搜索关键字:离散化    ( 1590个结果
线段树+离散化 IP地址段检查 SEGMENT TREE
Problem: Give a series of IP segments, for example, [0.0.0.1-0.0.0.3], [123.234.232.21-123.245.21.1]... Now there is a new IP, find which IP segment it's in ? Solution: First, we could map the end...
分类:其他好文   时间:2014-08-18 00:18:13    阅读次数:309
poj 1151 Atlantis 二分查找+离散化
Atlantis Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17464   Accepted: 6654 Description There are several ancient Greek texts that contain descriptions...
分类:其他好文   时间:2014-08-17 17:06:02    阅读次数:297
HDU 1828 Picture 线段树+扫描线
题意:给你一些矩形的左上角点的坐标和右下角点的坐标,求周长并最显而易见的思路就是对于x轴和y轴做两次扫描线,对于负数的坐标进行离散化。每次增加的值是线段变化量的绝对值。具体写法和求面积并的差不多。#include #include #include #include using namespace ...
分类:其他好文   时间:2014-08-17 14:12:52    阅读次数:206
HNU12884_Area Coverage(扫描线/线段树+离散化)
解题报告 题意: 又是求面积并 思路: 又是求面积并,还被坑了,题目明明描述的是int坐标,用了double才过。。。 #include #include #include #include using namespace std; struct Seg { double lx,rx,h; int v; friend bool operator <(Seg...
分类:其他好文   时间:2014-08-17 13:07:12    阅读次数:195
UVALive 4730 Kingdom 线段树+并查集
题目链接:点击打开链接 题意见白书P248 思路: 先把读入的y值都扩大2倍变成整数 然后离散化一下 用线段树来维护y轴 区间上每个点的 城市数量和联通块数量, 然后用并查集维护每个联通块及联通块的最大最小y值,还要加并查集的秩来记录每个联通块的点数 然后就是模拟搞。。 T^T绝杀失败题。。似乎数组开小了一点就过了,== #include #include #includ...
分类:其他好文   时间:2014-08-17 01:09:01    阅读次数:247
HDU 1542 Atlantis 线段树+离散化+扫描线
题意:给出一些矩形的最上角坐标和右下角坐标,求这些矩形的面积并。NotOnlySuccess 线段树专辑中扫描线模板题,弱智的我对着大大的代码看了一下午才搞懂。 具体见思路见注释=。=#include #include #include #include #define lson rt dy;vec...
分类:其他好文   时间:2014-08-16 21:01:21    阅读次数:218
POJ 2528 Mayor's posters (离散化+线段树区间更新)
Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city counci...
分类:其他好文   时间:2014-08-16 13:53:40    阅读次数:679
HDU 2227 Find the nondecreasing subsequences (DP+树状数组+离散化)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2227 Find the nondecreasing subsequences Time Limit: 10000/5000 MS (Java/Othe...
分类:其他好文   时间:2014-08-15 20:49:59    阅读次数:305
HDU 3743 Frosh Week (线段树+离散化)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3743 Frosh WeekTimeLimit:2000/1000ms(Java/Other)MemoryLimit:32768/32768K(Java/Other)...
分类:其他好文   时间:2014-08-15 20:49:49    阅读次数:327
POJ 1185 炮兵阵地(动态规划)
POJ 1185 炮兵阵地(动态规划) 题目大意: 炮兵有自己的攻击范围,P表示可以放炮兵,两个炮兵之间不能相互攻击,问你最多放置多少个炮兵。 解题思路: 离散化炮兵的状态,之枚举一层的有效状态,那么记录前两层,那么就可以算出第三层的最大值,动态规划。...
分类:其他好文   时间:2014-08-15 18:00:29    阅读次数:164
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!