码迷,mamicode.com
首页 >  
搜索关键字:combination sum ii    ( 27716个结果
BZOJ 2879 美食节(费用流-动态加边)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2879题意:有n道菜,每道菜需要b[i]份,m个厨师,第j个厨师做第i道菜需要时间a[i][j],求做完所有菜,所有人等待的最小总时间。思路:设所有的菜为sum。一个明显的思路是将每个厨师拆...
分类:其他好文   时间:2014-06-23 06:39:56    阅读次数:180
BZOJ 1003 物流运输trans(最短路)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=1003思路:m个点e条边n天。给出每条边的权值以及有些点有些天不能走。对于某连续的两天i和i+1,若两天从起点到终点选择的路径不同需要额外代价K。求最小的总代价:ans=sum(每天的代价)...
分类:其他好文   时间:2014-06-23 06:29:52    阅读次数:211
LeetCode Linked List Cycle II
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:其他好文   时间:2014-06-22 23:59:58    阅读次数:244
Leetcode:Minimum Path Sum 矩形网格最小路径和
Minimum Path Sum:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along...
分类:其他好文   时间:2014-06-22 23:06:39    阅读次数:290
HDU 3415 Max Sum of Max-K-sub-sequence
双向队列...
分类:其他好文   时间:2014-06-22 22:07:25    阅读次数:188
C语言--函数指针
#import #include "Function.h" int main(int argc, const char * argv[]) { // printf("%d\n",sum(10, 8)); // // int (*p)(int x,int y) = sum; // //函数指针类型 int (*)(int x,int y) // //描述: 指向 返回值为...
分类:编程语言   时间:2014-06-22 18:41:01    阅读次数:326
LeetCode:Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2],...
分类:其他好文   时间:2014-06-22 17:07:52    阅读次数:166
poj1564 Sum it up
搜索...
分类:其他好文   时间:2014-06-22 14:37:32    阅读次数:156
POJ 3071 Football (动态规划-概率DP)
POJ 3071 Football (动态规划-概率DP) 题目大意: 给定n,表示2^n次方个参赛者,接下来 2^n * 2^n 的矩阵,p[i][j] 表示 i 赢 j 的概率,现在是每次从1到2^n次方比赛,淘汰一半人,剩下的人在按照顺序比赛,1号和2号比,3号和4号 之类的顺序,问你最终谁赢的概率最大? 解题思路: 一道简单的概率DP题,只是我很cuo,看了别人的报告才会。 记dp[i][j]表示 第 i 场第 j 个人依然赢的概率。 那么转移就是:dp[i][j]=sum( dp[i-1][j]...
分类:其他好文   时间:2014-06-21 21:14:57    阅读次数:189
LeetCode——Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 求数字字符串的二进制和。同之前的数组代表数字,两个数组相加一样,只不过进位变成了2.可能两个串的长度不一样,故逆转,从左到右加下去,最后再逆转。 publi...
分类:其他好文   时间:2014-06-21 20:11:21    阅读次数:344
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!