贪心与分治
--JM
这个作者很懒,什么都没留下…
展开
-
线段线段
X轴上有N条线段,每条线段包括1个起点和终点。线段的重叠是这样来算的,10201020和12251225的重叠部分为12201220。给出N条线段的起点和终点,从中选出2条线段,这两条线段的重叠部分是最长的。输出这个最长的距离。如果没有重叠,输出0。Input第1行:线段的数量N(2 <= N <= 50000)。 第2 - N + 1行:每行2个数,线段的起点和终点。(...原创 2018-08-02 20:06:55 · 257 阅读 · 0 评论 -
vacations
Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of this n days: whether that gym opened and whether a contest was c...原创 2018-08-02 20:51:42 · 167 阅读 · 0 评论 -
A Sweet Journey
Master Di plans to take his girlfriend for a travel by bike. Their journey, which can be seen as a line segment of length L, is a road of swamps and flats. In the swamp, it takes A point strengths per...原创 2018-07-31 15:40:00 · 115 阅读 · 0 评论