码迷,mamicode.com
首页 >  
搜索关键字:poj 3273 二分    ( 34068个结果
HDOJ 4614 Vases and Flowers
线段树+二分区间 用线段树维护某一段内还有多少个花瓶可以用,二分确定插入的左右界..... Vases and Flowers Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1782    Accepted Submis...
分类:其他好文   时间:2014-07-22 23:05:54    阅读次数:307
POJ 3239 n皇后放置问题
以前那个是8皇后问题,用的递归写法,然后这个可以求n皇后放置问题,用的纯粹数学方法……神奇! #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #d...
分类:其他好文   时间:2014-07-22 23:04:55    阅读次数:205
POJ 3352 Road Construction 使得无向图边变双连通图
点击打开链接 Road Construction Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8168   Accepted: 4106 Description It's almost summer time, and that means that...
分类:其他好文   时间:2014-07-22 23:04:33    阅读次数:277
POJ 1920 Towers of Hanoi
OJ题目:click here~~ 题目分析:三根柱子 , n个圆盘 。给一个汉诺塔的状态,求将所有盘挪到一个柱子上的最少步数,并给出是最后在哪个柱子上。 从给定状态到目标状态很复杂,但是从目标状态到给定的状态就很容易想了。将一个柱子上i个盘,挪到另一个柱子上,需要pow(2,i) - 1步。 显然,最后在的那个柱子,一定是所给状态下最大盘所在的柱子。接下来考虑第二大的盘,需要移动就移动。……...
分类:其他好文   时间:2014-07-22 23:02:14    阅读次数:279
POJ 1463 Strategic game 最小点覆盖集(树形dp)
点击打开链接 Strategic game Time Limit: 2000MS   Memory Limit: 10000K Total Submissions: 6105   Accepted: 2808 Description Bob enjoys playing computer games, especially st...
分类:其他好文   时间:2014-07-22 23:01:55    阅读次数:304
poj 1011
经典的深搜题
分类:其他好文   时间:2014-07-22 23:00:34    阅读次数:226
sdut 2846 Remove Trees (二分 + 贪心)
题目和poj 上的一道题几乎一样。题意:已知n棵树距第一棵树的距离,求删掉m棵树后的 树之间 的最小距离 的最大值。思路:二分枚举最小的距离,注意二分的写法。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include...
分类:其他好文   时间:2014-07-22 22:59:15    阅读次数:249
poj 3342(树形dp)
题意:在一个公司中要举办一个聚会,每一个员工有一个奉献值。为了和谐规定直接上下级不能一起出席。让你找出奉献值之和最大为多少。思路:dp[v][1]表示当前结点选,能获得的最大奉献值,dp[v][0]表示当前节点不选能获得的最大奉献值。状态转移:dp[v][0] = max(dp[v][0], ∑ma...
分类:其他好文   时间:2014-05-01 22:30:47    阅读次数:485
HDU 2389 Rain on your Parade
http://acm.hdu.edu.cn/showproblem.php?pid=2389题意:给暴风雨到来的时刻,m个人的坐标和单位速度,和n个救生衣的坐标。每个救生衣只能匹配一个人,求最多有多少人可以得到救生衣。题解:典型二分图最大匹配题型。因为点比较多,使用Hopcroft-Karp算法。讲...
分类:其他好文   时间:2014-05-01 22:25:49    阅读次数:546
POJ 2342 (树形DP)
Anniversary partyTime Limit:1000MSMemory Limit:65536KTotal Submissions:3863Accepted:2172DescriptionThere is going to be ...
分类:其他好文   时间:2014-05-01 20:30:03    阅读次数:311
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!