1244. GentlemenTime limit: 0.5 secondMemory limit: 64 MBLet's remember one old joke:Once a gentleman said to another gentleman:— What if we play cards...
分类:
其他好文 时间:
2015-05-31 23:08:39
阅读次数:
212
题意:一棵含n个节点的树,保留m条边,使含m条边的子树的边权和最大;思路:树dp.求含m+1个节点边权和最大的子树。对每个分支节点有三种操作:剪去左子树;剪去右子树;将其节点数合理分配给左右子树; 记以x为根,含k个节点的子树的最大边权和为g[x][k]。 若x为叶节点,则g[x][k]...
分类:
移动开发 时间:
2015-05-31 10:57:32
阅读次数:
213
Description
The “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. R...
分类:
编程语言 时间:
2015-05-31 01:24:51
阅读次数:
160
1654. Cipher Message
Time limit: 1.0 second
Memory limit: 64 MB
Müller tried to catch Stierlitz red-handed many times, but alwaysfailed because Stierlitz could ever find some excuse. Once Sti...
分类:
其他好文 时间:
2015-05-30 14:59:32
阅读次数:
125
1018. Binary Apple TreeTime limit: 1.0 secondMemory limit: 64 MBLet's imagine how apple tree looks in binary computer world. You're right, it looks ju...
分类:
其他好文 时间:
2015-05-28 00:19:26
阅读次数:
215
2002. Test Task
Time limit: 0.5 second
Memory limit: 64 MB
It was an ordinary grim October morning. The sky was covered by heavy gray clouds. It was a little rainy. The rain drops fell on the...
分类:
其他好文 时间:
2015-05-25 20:27:31
阅读次数:
217
Problem DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical str...
分类:
其他好文 时间:
2015-05-21 23:57:35
阅读次数:
308
题目传送门 1 /* 2 简单递推DP:读题烦!在区间内的都更新一遍,dp[]初始化INF 3 注意:s1与s2大小不一定,坑! 4 详细解释:http://blog.csdn.net/kk303/article/details/6847948 5 */ 6 #include...
分类:
其他好文 时间:
2015-05-13 21:12:36
阅读次数:
114
题目传送门 1 /* 2 题意:程序从1到n版本升级,正版+正版->正版,正版+盗版->盗版,盗版+盗版->盗版 3 正版+破解版->正版,盗版+破解版->盗版 4 DP:每种情况考虑一遍,递推就行了 5 注意:开long long 6 */ 7 #i...
分类:
其他好文 时间:
2015-05-11 21:47:07
阅读次数:
144
题目传送门 1 /* 2 题意:给了两堆牌,每次从首部取出一张牌,按颜色分配到两个新堆,分配过程两新堆的总数差不大于1 3 记忆化搜索(DFS+DP):我们思考如果我们将连续的两个操作看成一个集体操作,那么这个操作必然是1红1黑 4 考虑三种情况:a[]连续两个颜色相同,输出...
分类:
其他好文 时间:
2015-05-11 21:44:31
阅读次数:
211