题目传送门 Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 41707 Accepted: 14125 Description People in Silverland use coins.They have coin ...
分类:
其他好文 时间:
2018-05-17 21:10:08
阅读次数:
163
Lintcode394 Coins in a Line solution 题解 ...
分类:
其他好文 时间:
2018-04-27 12:10:47
阅读次数:
145
Description Farmer John is at the market to purchase supplies for his farm. He has in his pocket K coins (1 <= K <= 16), each with value in the range ...
分类:
其他好文 时间:
2018-04-18 22:26:51
阅读次数:
161
COINS - Bytelandian gold coins #dynamic-programming #dynamic-programming In Byteland they have a very strange monetary system. Each Bytelandian gold c ...
分类:
其他好文 时间:
2018-04-11 19:13:27
阅读次数:
157
题目链接: https://vjudge.net/problem/UVA-562 题目大意: 给定n个硬币,要求将这些硬币平分以使两个人获得的钱尽量多,求两个人分到的钱最小差值 思路: 它所给出的n个钱币加起来sum,将sum/2当作体积,求出在sum/2下的最大值,sum-2*dp[sum/2] ...
分类:
其他好文 时间:
2018-04-11 00:19:03
阅读次数:
186
题目描述 Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest ...
分类:
其他好文 时间:
2018-04-10 21:56:10
阅读次数:
292
题目链接:http://poj.org/problem?id=1724 Input The first line of the input contains the integer K, 0 <= K <= 10000, maximum number of coins that Bob can sp ...
分类:
其他好文 时间:
2018-03-28 01:27:35
阅读次数:
224
Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou ...
分类:
其他好文 时间:
2018-03-27 10:21:04
阅读次数:
146
Here’s a jolly and simple game: line up a row of N identical coins, all with the heads facing down onto the table and the tails upwards, and for exact ...
分类:
其他好文 时间:
2018-03-15 01:45:23
阅读次数:
304
(1)思路暴力 会超时 (2) 用hash存储每个数被M减之后的数 注意这里会有重复的值所以要用数组存储其数量 再仔细思考一下,只要用数组存储每个数的数量即可,遍历的时候判断该数组v[M-i]元素的值是否大于1 未简化时的代码 ...
分类:
其他好文 时间:
2018-03-14 23:01:51
阅读次数:
181