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 coun...
分类:
其他好文 时间:
2014-08-14 16:46:38
阅读次数:
291
C - Picture
Time Limit:2000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
A number of rectangular posters, photographs and other pictures of ...
分类:
其他好文 时间:
2014-08-12 22:08:14
阅读次数:
460
题目链接:Mayor's posters
题意:按顺序往墙上贴海报,可以重叠,问最后可以看到多少海报。(被覆盖的海报是看不到的)
注意:
因为数据比较大,所以不离散化,肯定爆内存。
还有就是,不能只是单纯的离散化,还要处理好点的边界
举个例子
4
2 10.
2 8
3 6
6 8
8 10
离散化后
2 3 6 8 10
1 2 3 4 5
覆盖掉了
...
分类:
其他好文 时间:
2014-08-12 19:05:54
阅读次数:
228
E - 覆盖的面积
Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.
Input
输入数据的第一行是一个...
分类:
其他好文 时间:
2014-08-12 19:01:42
阅读次数:
290
~~~~
一直MLE,才发现要写离散化操作。其他就是线段树的成段更新(每次用不同标记去更新区间),最后统计下有多少种标记就OK了。
题目链接:http://poj.org/problem?id=2528
大牛写的很详细,请戳:http://blog.csdn.net/metalseed/article/details/8041334
~~~~
#include
#include
#inc...
分类:
其他好文 时间:
2014-08-11 21:34:43
阅读次数:
268
City Horizon
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 16206
Accepted: 4414
Description
Farmer John has taken his cows on a trip to the city! As the ...
分类:
其他好文 时间:
2014-08-11 21:19:42
阅读次数:
339
Atlantis
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
There are several ancient Greek texts that contain descriptions of ...
分类:
其他好文 时间:
2014-08-11 17:51:13
阅读次数:
261
解题报告
题意:
求逆序数。
思路:
线段树离散化处理。
#include
#include
#include
#include
#define LL long long
using namespace std;
LL sum[2001000],num[501000],_hash[501000];
void push_up(int rt)
{
sum[rt]=sum[rt...
分类:
其他好文 时间:
2014-08-11 00:22:01
阅读次数:
255
题目地址:POJ 2299
这题曾经用归并排序做过,线段树加上离散化也可以做。一般线段树的话会超时。
这题的数字最大到10^10次方,显然太大,但是可以利用下标,下标总共只有50w。可以从数字大的开始向树上加点,然后统计下标比它小即在它左边的数的个数。因为每加一个数的时候,比该数大的数已经加完了,这时候坐标在它左边的就是一对逆序数。
但是该题还有一个问题,就是数字重复的问题。这时候可以在排序...
分类:
其他好文 时间:
2014-08-10 15:43:20
阅读次数:
210
题目链接题意:中文题意。分析:纯手敲,与上一道题目很相似,但是刚开始我以为只是把cnt》=0改成cnt>=2就行了,、但是后来发现当当前加入的线段的范围之前 还有线段的时候就不行了,因为虽然现在都不等于2,但是之前的那个线段加上现在的已经覆盖2次了。 1 #include 2 #include...
分类:
其他好文 时间:
2014-08-09 18:28:29
阅读次数:
275