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

Gravatar
Satoshi
积分:3002
提交: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.
按重量从大到小排序,可以保证区间不会被漏掉

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Gravatar
sxysxy
积分:2485
提交:603 / 1120
补发一个评论,dinic暴力过的,一颗赛艇

Gravatar
TenderRun
积分:849
提交:201 / 529
http://www.cnblogs.com/TenderRun/p/5279893.html 我的博客:Blog (若,勿喷)