Problem Description
A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partial...
分类:
其他好文 时间:
2015-05-25 16:42:55
阅读次数:
110
也是区间更新,但这道题数据范围太大,要离散化
离散化即把涉及到的数字都记录下来,重新排过序后再用记录下来的下标作为其值,当使用其值进行比较时就可以根据下标找到对应的值
这里用了set判重,set是用insert插入的,而queue和stack都是用push插入值
#include
#include
#include
using namespace std;
#define N 10005
s...
分类:
其他好文 时间:
2015-05-15 19:58:59
阅读次数:
149
题意:给n张海报,按顺序贴海报,问最后能看到多少张不同的海报。解法:成段更新线段树 + 离散化。这道题因为给出的数字是单位长度,所以普通的离散化是有问题的,借鉴了大神的方法:http://notonlysuccess.me/?p=978一开始我的离散化方法是把单位长度改为数轴坐标……但是2 2 1....
分类:
其他好文 时间:
2015-05-14 14:03:50
阅读次数:
84
题目:
Mayor's posters
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 47228
Accepted: 13719
Description
The citizens of Bytetown, AB, could not stand th...
分类:
其他好文 时间:
2015-04-27 00:31:01
阅读次数:
220
Mayor's postersTime Limit: 1 SecMemory Limit: 256 MB题目连接http://poj.org/problem?id=2528DescriptionThe citizens of Bytetown, AB, could not stand that th...
分类:
其他好文 时间:
2015-04-21 19:56:12
阅读次数:
120
题意 在墙上贴n张海报 输入每张海报的的左右端点坐标 问最后可以看到多少张海报 能看到一点也是能看到
先把线段树初始化为0 输入一张海报 就把那个区间变成这张海报的序号 最后判断墙上有多少个不同的序号就行了
但是海报坐标的端点值高达10000000 直接用线段树会超时 但是注意到海报最多只有10000张 也就是最多有20000个不同的坐标 于是可以利用离散化的知识 把...
分类:
其他好文 时间:
2015-04-18 19:16:11
阅读次数:
161
Mayor's posters
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 46857
Accepted: 13601
Description
The citizens of Bytetown, AB, could not stand that the ca...
分类:
其他好文 时间:
2015-04-08 13:17:40
阅读次数:
135
Mayor's postersTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2528DescriptionThe citizens of Bytetown, AB, ...
分类:
其他好文 时间:
2015-04-05 08:56:45
阅读次数:
245
D - Mayor's posters
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit Status Practice POJ 2528
Description
The citizens of Bytetown, AB, could not stand that the candid...
分类:
其他好文 时间:
2015-04-04 18:32:53
阅读次数:
320
题目大意给出一些奶牛,一个人在原点观察,牛和牛之间又互相遮挡的关系,给出每头牛的运行方式和位置,问这个人最终会看到多少头牛。思路知道了运行方式,我们就知道这头牛在什么时间段会遮挡住人的视线,然后从高到低弄个东西维护一下覆盖什么的,这个题就变成了POJ的Mayor’s posters。
注意下时间点和时间段的区别就行了。CODE#define _CRT_SECURE_NO_WARNINGS#incl...
分类:
其他好文 时间:
2015-03-06 09:45:06
阅读次数:
183