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 walking out of the classroom and turned your head back, with the soft sunset glow shining on your rosy cheek, I knew, I knew that I was already drunk on you. Then, after several months’ observation and prying, your grace and your wisdom, your attitude to life and your aspiration for future were all strongly impressed on my memory. You were the glamorous and sunny girl whom I always dream of to share the rest of my life with. Alas, actually you were far beyond my wildest dreams and I had no idea about how to bridge that gulf between you and me. So I schemed nothing but to wait, to wait for an appropriate opportunity. Till now — the arrival of graduation, I realize I am such an idiot that one should create the opportunity and seize it instead of just waiting.

These days, having parted with friends, roommates and classmates one
after another, I still cannot believe the fact that after waving hands,
these familiar faces will soon vanish from our life and become no more
than a memory. I will move out from school tomorrow. And you are
planning to fly far far away, to pursue your future and fulfill your
dreams. Perhaps we will not meet each other any more if without fate and
luck. So tonight, I was wandering around your dormitory building hoping
to meet you there by chance. But contradictorily, your appearance must
quicken my heartbeat and my clumsy tongue might be not able to belch out
a word. I cannot remember how many times I have passed your dormitory
building both in Zhuhai and Guangzhou, and each time aspired to see you
appear in the balcony or your silhouette that cast on the window. I
cannot remember how many times this idea comes to my mind: call her out
to have dinner or at least a conversation. But each time, thinking of
your excellence and my commonness, the predominance of timidity over
courage drove me leave silently.

Graduation, means the end of life in university, the end of these
glorious, romantic years. Your lovely smile which is my original
incentive to work hard and this unrequited love will be both sealed as a
memory in the deep of my heart and my mind. Graduation, also means a
start of new life, a footprint on the way to bright prospect. I truly
hope you will be happy everyday abroad and everything goes well.
Meanwhile, I will try to get out from puerility and become more
sophisticated. To pursue my own love and happiness here in reality will
be my ideal I never desert.

Farewell, my princess!

If someday, somewhere, we have a chance to gather, even as
gray-haired man and woman, at that time, I hope we can be good friends
to share this memory proudly to relight the youthful and joyful
emotions. If this chance never comes, I wish I were the stars in the sky
and twinkling in your window, to bless you far away, as friends, to
accompany you every night, sharing the sweet dreams or going through the
nightmares together.



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. The window is a rectangle whose edges
are parallel to the x-axis or y-axis. Your task is to tell where I
should put the window in order to maximize the sum of the brightness of
the stars within the window. Note, the stars which are right on the edge
of the window does not count. The window can be translated but rotation
is not allowed.

Input

There
are several test cases in the input. The first line of each case
contains 3 integers: n, W, H, indicating the number of stars, the
horizontal length and the vertical height of the rectangle-shaped
window. Then n lines follow, with 3 integers each: x, y, c, telling the
location (x, y) and the brightness of each star. No two stars are on the
same point.

There are at least 1 and at most 10000 stars in the sky. 1<=W,H<=1000000, 0<=x,y<2^31.

Output

For each test case, output the maximum brightness in a single line.

Sample Input

3 5 4
1 2 3
2 3 2
6 3 1
3 5 4
1 2 3
2 3 2
5 3 1

Sample Output

5
6

Source

POJ Contest,Author:kinfkong@ZSU
【分析】
没什么好说的。。
把点转换成一个能被覆盖的矩阵,然后上扫描线。。。
 /*
唐代杜甫
《前出塞九首·其六》
挽弓当挽强,用箭当用长。射人先射马,擒贼先擒王。
杀人亦有限,列国自有疆。苟能制侵陵,岂在多杀伤。
*/

【POJ2482】【线段树】Stars in Your Window的更多相关文章

  1. 【POJ-2482】Stars in your window 线段树 + 扫描线

    Stars in Your Window Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11706   Accepted:  ...

  2. 【POJ2482】Stars in Your Window(线段树,扫描线)

    题意:在二维坐标系中有一些带权值的点,要求用一个长宽指定不能互换的框套住其中的一些,使得它们的权值和最大. n<=10000 x,y<=2^31 思路:首先按X排序,将Y坐标离散化,X坐标 ...

  3. POJ 2482 Stars in Your Window 线段树扫描线

    Stars in Your Window   Description Fleeting time does not blur my memory of you. Can it really be 4 ...

  4. POJ 2482 Stars in Your Window(线段树)

    POJ 2482 Stars in Your Window 题目链接 题意:给定一些星星,每一个星星都有一个亮度.如今要用w * h的矩形去框星星,问最大能框的亮度是多少 思路:转化为扫描线的问题,每 ...

  5. poj 2482 Stars in Your Window + 51Nod1208(扫描线+离散化+线段树)

    Stars in Your Window Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13196   Accepted:  ...

  6. 【POJ 2482】 Stars in Your Window(线段树+离散化+扫描线)

    [POJ 2482] Stars in Your Window(线段树+离散化+扫描线) Time Limit: 1000MS   Memory Limit: 65536K Total Submiss ...

  7. POJ 2482 Stars in Your Window (线段树+扫描线+区间最值,思路太妙了)

    该题和 黑书 P102 采矿 类似 参考链接:http://blog.csdn.net/shiqi_614/article/details/7819232http://blog.csdn.net/ts ...

  8. POJ 2482 Stars in Your Window 线段树

    如果按一般的思路来想,去求窗户能框住的星星,就很难想出来. 如果换一个思路,找出每颗星星能被哪些窗户框住,这题就变得非常简单了. 不妨以每个窗户的中心代表每个窗户,那么每颗星星所对应的窗户的范围即以其 ...

  9. Stars in Your Window(线段树求最大矩形交)

    题目连接 http://poj.org/problem?id=2482 Description Fleeting time does not blur my memory of you. Can it ...

随机推荐

  1. Myeclipse 保存jsp异常Save FailedCompilation unit name must end with .java, or one of the registered Java-like extensions

    如图 解决方法:去掉jsp页面的调试断点

  2. poj 1011 搜索减枝

    题目链接:http://poj.org/problem?id=1011 #include<cstdio> #include<cstring> #include<algor ...

  3. 对javabean的内省操作

    import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector ...

  4. C# 操作配置文件

    1.配置文件app.config的书写: string mdbPath = ConfigurationManager.AppSettings["mdbPath"].ToString ...

  5. 410. Split Array Largest Sum

    做了Zenefits的OA,比面经里的简单多了..害我担心好久 阴险的Baidu啊,完全没想到用二分,一开始感觉要用DP,类似于极小极大值的做法. 然后看了答案也写了他妈好久. 思路是再不看M的情况下 ...

  6. Linux安装sonarQube

    安装sonarQube之前,需要先安装JDK和mysql 服务器/home/azrlnx04/下创建三个文件夹,/java ./mysql. /sonar 一:安装JDK (1)打开http://ww ...

  7. C# 获取网页数据、获取本机IP 分类: C# 2014-12-16 14:59 308人阅读 评论(0) 收藏

    说明: (1) http://www.3322.org/dyndns/getip 这个网址可以获取本机IP,读取的内容就是本机IP (2)方法经测试,可以实现. (3)参考:http://www.cn ...

  8. UIApplication对象及其代理UIApplicationDelegate[转]

    在开发过程中我们需要一些全局对象来将程序的各个部分连接起来,这些全局对象中最重要的就是UIApplication对象.但在实际编程中我们并不直接和UIApplication对象打交道,而是和其代理打交 ...

  9. 三大框架常遇的错误:hibernate : object references an unsaved transient instance

    hibernate : object references an unsaved transient instance 该错误是操作顺序的问题,比如: save或update顺序问题---比方学生表和 ...

  10. cocos2d-x3.0-结合TH脚本引擎

    近期自己在研究手机游戏开发,呵呵.引擎就选择了cocos2d-x,略微看了下感觉好像非常不错的样子. 写个一般的游戏,全然能够了.工作量也不会非常大,相对来说开发非常轻松了. 在脚本引擎的选择其中,当 ...