题意:n个ren m个棍子 每个棍子可以与i个人结合
问最大有多少个结合#include#includeusing namespace std;int map[111][111];int fa[111];int
v[111];int n,m;int dfs(int x){ for(int i=...
分类:
其他好文 时间:
2014-05-01 13:22:34
阅读次数:
422
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3....
分类:
其他好文 时间:
2014-04-29 13:47:20
阅读次数:
251
We sometimes got memory leak problem, and we need to find the leaked memory, Here is a useful tool from MS, UMDH, it is included in WinDBG install package.
Here is a introduction on how to UMDH to identify memory leak problems...
分类:
其他好文 时间:
2014-04-29 13:38:21
阅读次数:
374
The plan of city rebuild
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 616 Accepted Submission(s): 215
Problem Description
New...
分类:
其他好文 时间:
2014-04-29 13:22:21
阅读次数:
438
解题思路:
求至少收到一份OFFER的最大概率,为了简化问题,求一份OFFER也没有收到的最小概率,然后1减去它就可以了。采用01背包,装入一份OFFER也没收到总概率的最小值,那么1减去它就是收到至少一份OFFER的最大概率。注意:dp[最大容量] 要有值,初始化时,而且本题dp数组初始化值为1
代码:
#include
#include
#include
using name...
分类:
其他好文 时间:
2014-04-29 13:21:22
阅读次数:
321
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at...
分类:
其他好文 时间:
2014-04-28 10:46:41
阅读次数:
311
Problem Description
Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!
Input
One N in one line, process to the end of file.
Output
For each N, output N! i...
分类:
其他好文 时间:
2014-04-28 10:36:41
阅读次数:
341
HDU 1520 Anniversary party
隔层选取,比较基础的树形DP了。
HDU 2196 Computer
我只想说一句这是毛线DP,明明是图论好么。
两次BFS求出权值和最大的一条链,再用两次BFS更新各点最大值。
搜了一下,真的有人用DP做,貌似更快一些。...
分类:
其他好文 时间:
2014-04-28 10:33:42
阅读次数:
282
题目描述
Cainiao is a university student who loves ACM contest very much. It is a festival for him once when he attends ACM Asia Regional Contest because he always can find some famous ACMers there.
C...
分类:
其他好文 时间:
2014-04-28 10:33:40
阅读次数:
340
http://acm.hdu.edu.cn/showproblem.php?pid=1595
大致题意:
给一个图,让输出从中删除任意一条边后所得最短路径中最长的。。
思路:
直接枚举每条边想必是不行的。其实有些边是不需要枚举的,因为删除它们并不影响起点到终点的最短路。起作用的边都是未删边前的最短路径上的边,删除它们最短距离肯定增大,只需在这些最短距离中求最大的即可。
记录最短路...
分类:
Web程序 时间:
2014-04-28 10:24:42
阅读次数:
393