码迷,mamicode.com
首页 >  
搜索关键字:poj    ( 20310个结果
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 2299 Ultra-QuickSort
Ultra-QuickSort Time Limit: 7000MS   Memory Limit: 65536K Total Submissions: 38588   Accepted: 13903 Description In this problem, you have to analyze a particular sorti...
分类:其他好文   时间:2014-07-22 23:02:34    阅读次数:303
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
POJ 2342 (树形DP)
Anniversary partyTime Limit:1000MSMemory Limit:65536KTotal Submissions:3863Accepted:2172DescriptionThere is going to be ...
分类:其他好文   时间:2014-05-01 20:30:03    阅读次数:311
[ACM] poj 1700 Crossing River (经典过河问题)
Crossing River Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 10212   Accepted: 3855 Description A group of N people wishes to go across a river with only one...
分类:其他好文   时间:2014-04-30 22:21:38    阅读次数:212
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!