【poj2528】Mayor's posters】的更多相关文章

Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 59254   Accepted: 17167 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 place…
Mayor's posters Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 64939   Accepted: 18770 Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral post…
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 council has finally decided to build an electoral wall for…
[poj2528]Mayor's posters Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 66154   Accepted: 19104 Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their elect…
题目 给定每张海报的覆盖区间,按顺序覆盖后,最后有几张海报没有被其他海报完全覆盖.离散化处理完区间端点,排序后再给相差大于1的相邻端点之间再加一个点,再排序.线段树,tree[i]表示节点i对应区间是哪张海报,如果是-1代表对应区间不是一张海报(0或多张).每贴一张海报,就用二分查找出覆盖的起点和终点对应的离散后的下标,然后更新区间.线段树的区间更新可以加上懒惰标记(或延迟标记,但是这题可以不用另外标记. #include<cstdio> #include<cstring> #in…
须要离散化处理,线段树的区间改动问题. 须要注意的就是离散化的时候,由于给的数字是一段单位长度,所以须要特殊处理(由于线段的覆盖和点的覆盖是不一样的) 比方:(1,10)(1,4) (6,10) 离散化之后是 1 , 4 , 6 , 10 分别离散为 1 2 3 4 覆盖的时候先覆盖1 4 之后覆盖了1 2 之后覆盖了 2 3,结果为2 可是实际上应该是3 13450359 201301052100 2528 Accepted 1140K 985MS C++ 1960B 2014-09-17 1…
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 council has finally decided to build an electoral wall for placing the…
Mayor's posters 转载自:http://blog.csdn.net/winddreams/article/details/38443761 [题目链接]Mayor's posters [题目类型]线段树+离散化 &题意: 给出一面墙,给出n张海报贴在墙上,每张海报都覆盖一个范围,问最后可以看到多少张海报 &题解: 海报覆盖的范围很大,直接使用数组存不下,但是只有最多10000张海报,也就是说最多出现20000个点,所以可以使用离散化,将每个点离散后,重新对给出控制的区间,这样…
poj2528 Mayor's posters 题意:在墙上贴海报,海报可以互相覆盖,问最后可以看见几张海报 思路:这题数据范围很大,直接搞超时+超内存,需要离散化: 离散化简单的来说就是只取我们需要的值来用,比如说区间[1000,2000],[1990,2012] 我们用不到[-∞,999][1001,1989][1991,1999][2001,2011][2013,+∞]这些值,所以我只需要1000,1990,2000,2012就够了,将其分别映射到0,1,2,3,在于复杂度就大大的降下来了…
Mayor's posters Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 39795   Accepted: 11552 Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral post…