贪心
Last0rder
最后之作
展开
-
经验
根据经验,贪心选择往往都在极端处(临界点)选择。原创 2014-05-09 22:37:16 · 651 阅读 · 0 评论 -
Codeforces Round #233 (Div. 1) A. Cards
A. Cardstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputUser ainta loves to play with cards. He has a cards containin原创 2015-01-21 19:52:57 · 1203 阅读 · 0 评论 -
hdu 5037 Frog
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2040 Accepted Submission(s): 616Problem DescriptionOnce upon a time, there原创 2015-02-21 13:26:43 · 889 阅读 · 0 评论 -
hdu4901Zombie’s Treasure Chest
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5006 Accepted Submission(s): 1032Problem Description Some brave warriors come to a原创 2015-04-05 19:28:41 · 884 阅读 · 0 评论 -
hdu1081To The Max
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8992 Accepted Submission(s): 4359Problem DescriptionGiven a two-dimensional array o原创 2015-04-13 19:37:26 · 846 阅读 · 0 评论 -
codeforces 556 D Case of Fugitive
这个题很显然,可以转换成这个问题:有n-1个区间,m个数,每个数最多只能用一次,第i个数只要能被第j个区间包含,那么这个数就可以放入这个区间内。求出,当所有区间里都恰有一个数时的情况。我们把所有区间按照下限升序排序,所有数升序排序之后分治即可。分治过程,维护一个元素为区间的小堆,堆顶是上限最小的区间。考虑第i个数,把所有能够包含它的区间都丢到堆中,然后从堆中丢一个区原创 2015-07-13 22:30:33 · 1445 阅读 · 0 评论