A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to...
分类:
其他好文 时间:
2016-01-23 18:01:48
阅读次数:
193
一开始以为是用DP解决,create a boolean array to store the status which mark whether the person can get to the end from current position.But, by this methods, we...
分类:
其他好文 时间:
2016-01-19 14:06:45
阅读次数:
133
牛杂技团 题目大意:一群牛想逃跑,他们想通过搭牛梯来通过,现在定义risk(注意可是负的)为当前牛上面的牛的总重量-当前牛的strength,问应该怎么排列才能使risk最小? 说实话这道题我一开始给书上的二分法给弄懵了,后来看了一下题解发现...
分类:
其他好文 时间:
2016-01-15 01:08:47
阅读次数:
292
Greedy DriverTime Limit: 2000msMemory Limit: 65536KBThis problem will be judged on ZJU. Original ID: 3794 64-bit integer IO format: %lld ...
分类:
其他好文 时间:
2015-11-14 23:13:01
阅读次数:
371
贪婪的送礼者【实在好难翻译,我就把题目发上来】一群要互送礼物的朋友。在这一个问题中,每个人都准备了一些钱来送,而这些钱将会被平均分给那些将收到他的礼物的人。然而,在任何一群朋友中,有些人将送出较多的礼物(可能是因为有较多的朋友),有些人有准备了较多的钱。给出一群朋友,没有人的名字会长于14字符,给出...
分类:
其他好文 时间:
2015-11-14 13:47:17
阅读次数:
239
WallTime Limit:1000MSMemory Limit:10000KTotal Submissions:32808Accepted:11137DescriptionOnce upon a time there was a greedy King who ordered his chief...
分类:
其他好文 时间:
2015-11-10 12:23:42
阅读次数:
325
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.思路:对于某一点来说,在经过该点的直线中选取节点数量最多的直线;对于全局来说,必定是某个局部点满足条件的直...
分类:
其他好文 时间:
2015-10-30 20:35:54
阅读次数:
289
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:
其他好文 时间:
2015-10-30 20:29:23
阅读次数:
241
保护花朵 题目大意:就是农夫有很多头牛在践踏花朵,这些牛每分钟破坏D朵花,农夫需要把这些牛一只一只运回去,这些牛各自离牛棚都有T的路程(有往返,而且往返的时候这只牛不会再破坏花),问怎么运才能使被践踏的花最少? 一开始我做这道题...
分类:
其他好文 时间:
2015-10-21 20:59:24
阅读次数:
199
Should be "Medium" or even "Easy".. Just with a little Greedy.class Solution {public: /** * @param S: A list of integers * @return: An inte...
分类:
其他好文 时间:
2015-10-21 08:06:15
阅读次数:
286