多种方法,我用DP做的。
我当成的 最长下降子序列做的。 问了下其他人,有树形DP的,有差分约束用最短路的。
还有当作 二维的背包问题的。
最长单调子序列,长宽高 x,y,z 分别枚举成六个。然后排序,找最长单调子序列即可。
#include
#include
#include
#include
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-11-27 10:48:57
阅读次数:
228
ural 2029 Towers of Hanoi Strike Back链接:http://acm.timus.ru/problem.aspx?space=1&num=2029题意:汉诺塔问题,给定一串只有(A, B, C)的字符串(A代表在第一根柱子,B代表在第二根柱子,C代表在第三根柱子),从...
分类:
其他好文 时间:
2014-11-26 18:36:17
阅读次数:
214
A. Giga Tower模拟即可,略过B. Candy Boxes四个整数x1..x4,满足x10,那么Y就赢了。y可以买属性,每一点的价格分别为h,a,d给定他们两个的三个属性值,给定价格,问y要战胜怪物m需要花费最少多少钱在买属性上?给定的属性值都在[1,100]剪枝搜索defy最大为100,...
分类:
其他好文 时间:
2014-11-23 15:43:28
阅读次数:
153
题目链接:http://codeforces.com/problemset/problem/488/A题目意思:给出一个数a,范围是[-10^9, 10^9],问它最少需要加的一个正整数 b 是多少,条件是加完之后这个数至少有一位有 8. 有一个小小的意外,改了好久啊~~~~负数的情况,需要乘上 ....
分类:
其他好文 时间:
2014-11-22 17:13:30
阅读次数:
245
??
Description
Battle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which has L longevity. The player has a military factory, which can
...
分类:
其他好文 时间:
2014-11-19 22:26:25
阅读次数:
316
DescriptionThe cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 //把多重...
分类:
其他好文 时间:
2014-11-11 22:24:28
阅读次数:
232
详细讲解汉诺塔算法的原理,并且提供了动态演示程序,帮助读者理解!!!...
分类:
其他好文 时间:
2014-11-04 17:23:45
阅读次数:
181
竟然忘记了汉诺塔递归了。。。有3个柱子,有n个盘子在A柱子,需要通过B把n个盘子放到C的柱子上。盘子都是从上到下半径依次增大的hanoi(int n,char A,char B,char C)//通过B把A上的n个盘放到C上{ if(n==1) move(1,A,C);//如果是编号为1的盘就...
分类:
其他好文 时间:
2014-11-03 06:40:53
阅读次数:
216
The Tower of Babylon
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 2207
Accepted: 1244
Description
Perhaps you have heard of the legend of the Tower of Bab...
分类:
其他好文 时间:
2014-11-01 10:07:15
阅读次数:
259
一不小心接触到Simditor,瞬间被它优美极简的界面所吸引。Simditor是Tower开源的所见即所得的在线富文本编辑器。Simditor的理念是保持简单,避免过度的功能,每一个特性都追求极致的用户体验。使用方法1、在你的html页面中引用如下文件...
分类:
其他好文 时间:
2014-10-27 23:03:58
阅读次数:
1460