上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: 题目大意:给两个数字a,b求出[a,b]中转化成二进制后0的个数大于等于1的个数的数例如1100转化成10-11,100-111,1000-1011,1100。保证每个区段都有1打头,然后有一段数字任选用组合数求;代码如下#include#include#includeusing namespace... 阅读全文
posted @ 2015-01-19 19:30 icodefive 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 基因配对 给出俩基因链和配对的值 求配对值得最大值 简单dp#include#include#includeusing namespace std;const int maxa = 205;const int mina = -100000000;char str1[maxa], str2[maxa]... 阅读全文
posted @ 2014-12-26 21:37 icodefive 阅读(159) 评论(0) 推荐(0) 编辑
摘要: a.水b.n长度的街道有m个路灯,给出每个路灯的位置,求灯光能覆盖所有地方的最小灯光半径,水;c.小明有n们课程要达到一个规定的总分数,一直目前每科达到的分数和每科的总分,买每门课程分数所需费用给出,问最少得花多少钱;贪心,水;d.两个人刷怪,问谁能给出最后一击,给出怪物的血量,小明每1/m秒出击一... 阅读全文
posted @ 2014-12-23 10:06 icodefive 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 树形最大上升子序列这里面的上生子序列logn的地方能当模板使 good#include#include#include#include#includeusing namespace std;const int maxa = 6006;vectore[maxa];int d[maxa];int a[m... 阅读全文
posted @ 2014-12-10 13:13 icodefive 阅读(165) 评论(0) 推荐(0) 编辑
摘要: AA monster is attacking the Cyberland!Master Yang, a braver, is going to beat the monster. Yang and the monster each have 3 attributes: hitpoints (HP)... 阅读全文
posted @ 2014-11-28 22:18 icodefive 阅读(211) 评论(0) 推荐(0) 编辑
摘要: a.给俩数, 求他俩之间二进制数中1最多的,有多个输出最小的;贪心,从小到大加能加就加,最后可能碰到一个不能加了但是当前数比l小,那么就加上这个数,然后从大到小,能减就减,见到符合条件#include#include#includeusing namespace std;int main(){ ... 阅读全文
posted @ 2014-11-19 12:56 icodefive 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题意给一棵树,每个点有权值,求出有多少子树满足最大最小权值差#include#includeusing namespace std;const long long maxa = 2005;long long a[maxa];long long edge[maxa][maxa];long long o... 阅读全文
posted @ 2014-11-12 19:17 icodefive 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 前天做了一个题,就是个简单的状压记忆化搜索,但是debuge了俩小时,给我整的快吐血了,各种不可思议的错误,我都要怀疑是不是电脑有毛病了,后来发现数组开小了,看来以后遇到不可思议的错误就要检查数组开没开小。。。。。 阅读全文
posted @ 2014-11-12 13:04 icodefive 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 迭代每个数对应前面的一个数#include#includeusing namespace std;#define max 88long long s[max], n,p;char *first="T.T^__^";void Init(){ s[0]=7; s[1]=10; int ... 阅读全文
posted @ 2014-10-22 20:09 icodefive 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题意:有两个字符串,每个串由n个字符组成,每个字符有一个价值,Roy每次指定串2中的一个字符,他的得分增加的值为这个字符的价值,然后把两个串中这个字符前面的那部分(包括这个字符)删掉,重复进行这样的操作,求Roy最多能得多少分。dp[i][k] 存的前str1的前i个和str2的前k个能取得最大值,... 阅读全文
posted @ 2014-10-22 19:39 icodefive 阅读(149) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页