The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all pl ...
分类:
其他好文 时间:
2017-08-25 12:32:37
阅读次数:
189
解题报告 地址传送门 题意: 一些海报,覆盖上去后还能看到几张。 思路: 第一道离散化的题。 离散化的意思就是区间压缩然后映射。 给你这么几个区间[1,300000],[3,5],[6,10],[4,9] 区间左右坐标排序完就是 1,3,4,5,6,9,10,300000; 1,2,3,4,5,6, ...
分类:
其他好文 时间:
2017-08-16 17:06:49
阅读次数:
138
题目链接: http://poj.org/problem?id=2528 解题思路: 线段树+离散化。10000个线段,20000个点,所以线段树最大是80000。离散化的方法:首先保存每个端点,然后排序+去重(unique函数)之后从头到尾映射一下就可以了。 更新时可以从后往前进行,这样,由于前面 ...
分类:
其他好文 时间:
2017-08-06 16:05:28
阅读次数:
167
[poj2528]Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 66154 Accepted: 19104 Description The citizens of Bytetown, AB, co ...
分类:
其他好文 时间:
2017-07-30 23:48:56
阅读次数:
235
甚至DFS也能过吧 Mayor's posters POJ - 2528 The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been plac ...
分类:
其他好文 时间:
2017-07-24 14:53:04
阅读次数:
199
Mayor's posters Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 64939 Accepted: 18770 Description The citizens of Bytetown, AB, could not s ...
分类:
其他好文 时间:
2017-07-09 22:07:06
阅读次数:
183
题目大意:有t组数据,每组数据给你n张海报(1<=n<=10000),下面n组数据分别给出每张海报的左右范围(1 <= l <= r <= 10000000),下一张海报会覆盖前一张海报,求最后可见(包括完全和不完全可见)的海报有几张。 例如: 如上图所示,答案为4。 解题思路:其实这是一道区间染色 ...
分类:
其他好文 时间:
2017-07-08 17:48:45
阅读次数:
175
本题就是要往墙上贴海报,问最后有多少可见的海报。 事实上本题的难点并非线段树,而是离散化。 由于数据非常大,直接按原始数据计算那么就会爆内存和时间的。 故此须要把数据离散化。 比方有海报1 6 7 9 20 100 5 1000的原始数据。直接计算须要1-1000的内存,离散化之后仅仅须要8内存,由 ...
分类:
其他好文 时间:
2017-05-31 20:49:25
阅读次数:
176
题目大意:给出一些海报和贴在墙上的区间。问这些海报依照顺序贴完之后,最后能后看到多少种海报。 思路:区间的范围太大,然而最多仅仅会有10000张海报,所以要离散化。之后用线段树随便搞搞就能过。 关键是离散化的方法,这个题我时隔半年才A掉,之前一直就TTT,我还以为是线段树写挂了。当我觉得我自己的水平 ...
分类:
其他好文 时间:
2017-05-03 20:39:37
阅读次数:
133
Problem Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertic ...
分类:
其他好文 时间:
2017-04-29 12:58:03
阅读次数:
210