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. Light OJ 1050 - Marbles(概率DP)

    题目大意: 一个包裹里有蓝色和红色的弹珠,在这个包裹里有奇数个弹珠,你先走, 你先从背包里随机的拿走一个弹珠,拿走每个弹珠的可能性是一样的.然后Jim从背包里拿走一个蓝色的弹珠,如果没有蓝色的弹珠让J ...

  2. 利用MVC的过滤器实现url的参数加密和解密

    最近在与一个IOS应用做接口对接,之前一直都没有遇到什么很大的问题,但是有一天发现可以通过软件解析app的url,然后直接通过url的拼接修改接口数据,这一下使得数据的安全性和准确性都降低了,于是就想 ...

  3. 身为java程序员你需要知道的网站(包含书籍,面试题,架构...)

    推荐几本书<高级java程序员值得拥有的10本书>,     首页 所有文章 资讯 Web 架构 基础技术 书籍 教程 我要投稿 更多频道 » - 导航条 - 首页 所有文章 资讯 Web ...

  4. Delphi 编写的Web Service

      一编写服务程序 第一步:File----->New----->Other------>WebServices----->Soap Server Application选择I ...

  5. robotium源码方法备注---clicker.java

    1.clickOnScreen(float x,float y) 在屏幕上点击一个指定的区域(x,y)横纵坐标 2.clickLongOnScreen(float x,float y, int tim ...

  6. Unity Flow distort of screen

    Shader "ScreenWater" {Properties { _MainTex ("Base (RGB)", 2D) = "white&quo ...

  7. UVAlive 3263 That Nice Euler Circuit(欧拉定理)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=21363 [思路] 欧拉定理:V+F-E=2.则F=E-V+2. 其 ...

  8. (二)Eclipse 快捷键

    编辑 Ctrl+1 快速修复(最经典的快捷键,就不用多说了,可以解决很多问题,比如import类.try catch包围等)Ctrl+Shift+F 格式化当前代码Ctrl+Shift+M 添加类的i ...

  9. Maven 打胖jar

    自己去看原版:http://www.mkyong.com/maven/create-a-fat-jar-file-maven-assembly-plugin/ 一个Eclipse的工程,在pom中配置 ...

  10. UVa10886 Standard Deviation

    留坑(p.345) 这是什么意思 暴力? 然而那些有两个人跑的那么快是为什么?(有个人竟然是陈锋...)