Stars in Your Window POJ - 2482】的更多相关文章

错误记录: 题目说输入在int范围内,但是运算过程中可能超int:后来开了很多longlong就过了 #include<cstdio> #include<algorithm> #include<cstring> #include<vector> #include<map> using namespace std; #define fi first #define se second #define mp make_pair #define pb…
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…
[POJ 2482] Stars in Your Window(线段树+离散化+扫描线) Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11294   Accepted: 3091 Description Fleeting time does not blur my memory of you. Can it really be 4 years since I first saw you? I still remembe…
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…
1208 Stars in Your Window 题目来源: Poj 基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题  收藏  取消关注 整点上有N颗星星,每颗星星有一个亮度.用一个平行于x轴和y轴,宽为W高为H的方框去套星星.套住的所有星星的亮度之和为S(包括边框上的星星),求S的最大值. Input 第1行:共3个数N, W, H,中间用空格分割,N为星星的数量,W为方框的宽度,H为方框的高度.(2 <= N <= 50000, 1 <= W,…
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…
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…
[poj P2482] Stars in Your Window Time Limit: 1000MS  Memory Limit: 65536K 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…
题目连接 http://poj.org/problem?id=2482 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…