随笔分类 -  贪心笔记

摘要:Problem DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that he will need to spend each day over the nextN(1 ≤N≤ 100,000) days.FJ wants to create 阅读全文
posted @ 2013-10-21 15:31 persistent codeants 阅读(219) 评论(0) 推荐(0)
摘要:Problem DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a rock at the start and another rock at the end,Lunits away from the start (1 ≤L≤ 1,0 阅读全文
posted @ 2013-10-21 14:57 persistent codeants 阅读(195) 评论(0) 推荐(0)
摘要:1106. Two TeamsTime limit: 1.0 second Memory limit: 64 MBThe group of people consists ofNmembers. Every member has one or more friends in the group. You are to write program that divides this group into two teams. Every member of each team must have friends in another team.InputThe first line of inp 阅读全文
posted @ 2013-08-04 21:35 persistent codeants 阅读(265) 评论(0) 推荐(0)
摘要:Given set of line segments [Li, Ri] with integer coordinates of their end points. Your task is to find the minimal subset of the given set which covers segment [0, M] completely (M is a positive integer).InputFirst line of the input contains an integer M (1≤M≤5000). Subsequent lines of input contain 阅读全文
posted @ 2013-08-03 16:21 persistent codeants 阅读(227) 评论(0) 推荐(0)