poj2528专题

poj2528 Mayor's posters 【线段树】

题目难度还好只要知道流程了,代码基本能写出来 大致思路是:对所有区间的端点进行排序,并离散化节省空间时间 然后读入每一张海报,更新所表示的区间,最后统计能看得到多少张海报 比较坑的是,这题卡scanf,用c++交过的,载上一篇文章 https://www.byvoid.com/blog/fast-readfile C++中的快速读取 #include <map>#include <se

poj2528 Mayor's posters(线段树的离散化)

题目链接:http://poj.org/problem?id=2528 分析:其实离散化就是将一个很大的区间映射为一个很小的区间,而不改变原有的大小覆盖关系。但是注意简单的离散化可能  会出现错误,给出下面两个简单的例子应该能体现普通离散化的缺陷: 例子一:1-10 1-4 5-10 例子二:1-10 1-4 6-10 普通离散化后都变成了[1,4][1,2][3,4] 线段2覆盖了[1,

POJ2528 Mayor's posters(线段树区间更新,离散化)

题目: Mayor's posters Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 66425 Accepted: 19177 Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral e