Description Here comes the problem: Assume the sky is a flat plane. All the stars lie on it with a location (x, y). for each star, there is a grade ranging from 1 to 100, representing its brightness, where 100 is the brightest and 1 is the weakest. T…
id=2482" target="_blank" style="">题目链接:poj 2482 Stars in Your Window 题目大意:平面上有N个星星.问一个W∗H的矩形最多能括进多少个星星. 解题思路:扫描线的变形.仅仅要以每一个点为左上角.建立矩形,这个矩形即为框框左下角放的位置能够括到该点,那么N个星星就有N个矩形,扫描线处理哪些位置覆盖次数最多. #include <cstdio> #include <cstr…
POJ 2482 Stars in Your Window 题目链接 题意:给定一些星星,每一个星星都有一个亮度.如今要用w * h的矩形去框星星,问最大能框的亮度是多少 思路:转化为扫描线的问题,每一个星星转化为一个矩形,那么等于求矩形相交区域值最大的区域,利用线段树去维护就可以 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long…
Stars in Your Window Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13196   Accepted: 3609 Description Fleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beaut…
Stars in Your Window   Description Fleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remember, vividly, on the beautiful Zhuhai Campus, 4 years ago, from the moment I saw you smile, as you were walk…
题目链接:http://poj.org/problem?id=2482 读完题干不免有些心酸(…
[题目链接] http://poj.org/problem?id=2482 [题目大意] 给出一些点的二维坐标和权值,求用一个长H,宽W的矩形能框住的最大权值之和, 在矩形边缘的点不计算在内 [题解] 我们计算能扫到这个点的区间范围,将其拆分为两条平行于y轴的左闭右开的直线, 为方便边界处理,我们将坐标扩大两倍,之后我们按照x轴对这些线段进行扫描 统计出现的最大值即可. [代码] #include <cstdio> #include <algorithm> #include <…
遇见poj上最浪漫的题目..题目里图片以上几百词为一篇模板级英文情书.这情感和细腻的文笔深深地打动了我..不会写情书的童鞋速度进来学习.传送门 题意:坐标系内有n个星星,每个星星都有一个亮度c (1<= c <= 100),坐标和亮度都已给出. 有一个矩形的窗户(就是个理想化的矩形),四条边与x轴或y轴平行.矩形可以在坐标系内平移,但不可以进行旋转操作.求这个矩形可以框住的星星的亮度之和最大为多少.注意:恰好在边上的星星不算在内. 思路:好吧,这题又是看别人的题解才做出来的,深深自责中...思…
该题和 黑书 P102 采矿 类似 参考链接:http://blog.csdn.net/shiqi_614/article/details/7819232http://blog.csdn.net/tsaid/article/details/6686907http://www.cnblogs.com/372465774y/archive/2012/07/28/2613272.html 题意: 给你10000以内的星星的坐标和星星的亮度(即分别为x,y,c),要求用W*H的矩形去围住一个区域, 使得…
线段树+离散化+扫描线 AC之后,又认真读了一遍题目,好文章. #include<cstdio> #include<map> #include<algorithm> using namespace std; +; int n; long long W,H; long long x[maxn],y[maxn],v[maxn]; struct seg { long long X; long long Y1,Y2; long long val; }s[*maxn]; stru…