zys
积分:1679
提交:471 / 964
回复 @Satoshi :

Satoshi
积分:2996
提交:678 / 1922
作者请加数据范围

神利·代目
积分:3115
提交:802 / 1626
同样是n^3的做法,为什么差别这么大?

Satoshi
积分:2996
提交:678 / 1922
证明:
Sort the haybales by location. Consider two haybales i and j such that Bessie can start somewhere between those haybales and break through all the haybales from i+1 to j−1, but she can't break haybale i or haybale j.
It must be the case then that no haybale between i and j is strictly taller than those two.
That motivates the following O(NlogN)solution:
Sort the haybales in decreasing order of size. Consider having an empty road, and place the haybales in that order. When placing a haybale, look immediately to its left and to its right and see if you can break through either one of those haybales if you were inside that interval. Mark that interval as "trapped" if so.
This will be O(NlogN)
as long as you check to make sure that the interval isn't already marked as trapped.
按重量从大到小排序,可以保证区间不会被漏掉

mikumikumi
积分:4118
提交:830 / 1893
莫比乌斯反演的裸题。。

asddddd
积分:614
提交:109 / 351
我竟然把sv设成0了。。。都可以去卖萌了QAQ

stdafx.h
积分:3332
提交:889 / 1556
这个题竟然半颗星....

题目 1389 number-b
2016-04-05 14:54:17
stdafx.h
积分:3332
提交:889 / 1556
最后一句话亮了...话说让他切题的那个人做我右面的右面的左面

葳棠殇
积分:1417
提交:362 / 782
最后一句话亮了...话说让他切题的那个人做我右面的右面

stone
积分:1531
提交:406 / 764
貌似如果数据是一个标准的矩形,就会被卡掉。。。。。 $\sum poet$

铁策
积分:988
提交:301 / 737
%%%%%%
妈蛋银组题都那么丧(wu)病(liao)。。。
我是不是弱的没救了呢

assassain
积分:1068
提交:233 / 619
最后一句话亮了。。。。。。

0
积分:1999
提交:530 / 1238
最后一句话亮了。。。。。。

stdafx.h
积分:3332
提交:889 / 1556
最后一句话亮了。。。。。。

神利·代目
积分:3115
提交:802 / 1626
最后一句话亮了。。。。。。

1azyReaper
积分:774
提交:185 / 380
强占一楼

Satoshi
积分:2996
提交:678 / 1922
回复 @葳棠殇 :
CF某题跟这个一样吗?

Satoshi
积分:2996
提交:678 / 1922
二维前缀和+单调队列,暴力是O((NM))^2的枚举矩形左上角和右下角,但是我们可以利用矩形的特殊性质,单调队列滑一滑就可以了,有时间写题解

葳棠殇
积分:1417
提交:362 / 782
HHD...

题目 2206 Travel
2016-04-05 07:05:30
sxysxy
积分:2477
提交:603 / 1120
补发一个评论,dinic暴力过的,一颗赛艇