01背包变形,注意dp过程的时候就需要取膜,否则会出错。 代码如下: ...
分类:
其他好文 时间:
2016-10-06 19:55:07
阅读次数:
180
A.Nearest Neighbor Search B.Odd Discount C.Eight Queens D.Longest Common Subsequence E.Coins F.Floyd-Warshall G.Road History H.Around the World I.Long ...
分类:
其他好文 时间:
2016-10-05 21:54:56
阅读次数:
157
CoinsInput file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 1024 megabytesIn ICPCCamp, people usually use coins of va ...
分类:
其他好文 时间:
2016-10-02 15:08:04
阅读次数:
167
The Fewest Coins Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6299 Accepted: 1922 Description Farmer John has gone to town to buy some f ...
分类:
其他好文 时间:
2016-09-23 21:16:55
阅读次数:
194
There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take t ...
分类:
其他好文 时间:
2016-09-11 14:09:01
阅读次数:
210
准备开刷这充满神秘感的八道题,虽然我不是男的。。。 完成度:3/8 2016.7.~? poj1742 Coins 题意:给你n种面值的硬币和每种硬币的数量。求1~m中有多少个可以用这些硬币组成。 算法:dp 解析:dp[i][j]表示用前i中硬币组成j时第i种硬币剩余的枚数(若不能组成j则为-1) ...
分类:
其他好文 时间:
2016-09-11 10:23:08
阅读次数:
198
标签: 动态规划 问题描述: There are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no mor ...
分类:
其他好文 时间:
2016-09-08 06:18:02
阅读次数:
186
There are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take t ...
分类:
其他好文 时间:
2016-09-03 21:14:59
阅读次数:
146
题意:有n个硬币,每个硬币有个价值,两个人分配硬币,要求最公平分配时候两人拿到的钱的差。 分析:很明显,两人拿到的钱的差越小越公平。 一开始想,一定是一人一半最公平,所以直接把总和sum/2,对着half跑01背包,但是WA了,修改后分别讨论奇偶,额外进行一次sum-half的01背包,也WA,仔细 ...
分类:
其他好文 时间:
2016-09-01 23:11:07
阅读次数:
378
Removing coins in Kem Kadrãn Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Gym 101047M Removing coins in Kem Kadrãn Gym 101047M ...
分类:
其他好文 时间:
2016-08-24 11:21:15
阅读次数:
266