欢迎访问我的个人网站==》 jiashubing.cn
摘要: Jurassic RemainsPaleontologists in Siberia have recently found a number of fragments of Jurassic period dinosaur skeleton. The paleontologists have decided to forward them to the paleontology museum. Unfortunately, the dinosaur was so huge, that there was no box that the fragments would fit into. Th 阅读全文
posted @ 2013-09-20 22:19 贾树丙 阅读(457) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3374题目大意:JAVAMAN 到梦幻城市旅游见到了黄金树,黄金树上每天回结出金子。已经有n棵树,JAVAMAN要停留m天,每天只能砍掉一棵树,砍掉树后就能得到树上的黄金。给定n棵树上原有的黄金a[i]和每天可以新增加的黄金b[i],求他最多可以得到多少黄金。中途如果有1天不砍树的话,之后的日子久不能砍树,所有最好每天都砍树,或者直到树被砍完。Sample Input22 110 101 12 28 102 3Sample Output1021Hints:Test 阅读全文
posted @ 2013-09-20 21:45 贾树丙 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1702题目大意:给定有很多数字组成的诗,譬如“AABB”, “ABAB”, “ABBA” and “AAAA”形式的诗句是押韵的。从中挑选,求最多可以构成多少押韵句,并且输出这些句子在原序列中的位置。Sample Input151 2 3 1 2 1 2 3 3 2 1 1 3 2 231 2 3Sample Output31 2 4 57 8 9 1011 12 14 150分析:设dp[i]表示从 1 到 i 之间押韵句的最大数目,f(i,j)表示当[i,j]之 阅读全文
posted @ 2013-09-20 12:15 贾树丙 阅读(331) 评论(0) 推荐(0) 编辑
摘要: unique()函数是一个去重函数,STL中unique的函数 unique的功能是去除相邻的重复元素(只保留一个),还有一个容易忽视的特性是它并不真正把重复的元素删除。他是c++中的函数,所以头文件要加#include<iostream>,#include<algoritjm>,具体用法如下: i 阅读全文
posted @ 2013-09-20 11:36 贾树丙 阅读(1996) 评论(0) 推荐(0) 编辑