上一页 1 ··· 3 4 5 6 7 8 下一页

2017年7月15日

ST和LCA和无根树连接

摘要: 题目连接:http://codevs.cn/problem/2370/ 阅读全文

posted @ 2017-07-15 17:02 chinacwj1 阅读(161) 评论(0) 推荐(0) 编辑

2017年7月14日

暑期集训7/14

摘要: 网址:https://vjudge.net/contest/170761#overview A题思路: B题思路: C题思路: 题目要求: 求最长连续子串,在相等大小下,长度要求最长,再起点最小。 思路: 因为ans都是大于等于零的,所以我们就当加到sum小于零时,就把sum归零,起点变成当前的i, 阅读全文

posted @ 2017-07-14 19:47 chinacwj1 阅读(123) 评论(0) 推荐(0) 编辑

2017年7月9日

kmp算法

摘要: next和nextval的区别就是nextval就是next的优化,但是他们大部分相同。 这两个数组就是出现不匹配的情况的时候,j指针要移动到那个位置(j就是子串的指针) next数组的算法原理还没理解,先借鉴大佬的博客(http://blog.csdn.net/guo_love_peng/arti 阅读全文

posted @ 2017-07-09 22:33 chinacwj1 阅读(144) 评论(0) 推荐(0) 编辑

2017年6月27日

manacher算法

摘要: hdu:3068 #include <stdio.h>#include <iostream>#include <string.h>#include <algorithm>using namespace std;int min(int a,int b){ return a<b?a:b;}char s[ 阅读全文

posted @ 2017-06-27 01:38 chinacwj1 阅读(141) 评论(0) 推荐(0) 编辑

2017年6月25日

dp之多重背包(二进制优化)

摘要: void solve(int v,int w,int c){ int count=0; for(int k=1;k<=c;k<<=1) { val[count]=k*v; size[count++]=k*w; c-=k; } if(c>0) { val[count]=c*v; size[count+ 阅读全文

posted @ 2017-06-25 22:15 chinacwj1 阅读(308) 评论(0) 推荐(0) 编辑

2017年6月20日

dp之多重背包(未用二进制优化)

摘要: hdu 2191: #include <iostream>#include <stdio.h>#include <string.h>using namespace std;int main(){ int T; scanf("%d",&T); int num[1005]; int weight[100 阅读全文

posted @ 2017-06-20 15:50 chinacwj1 阅读(202) 评论(0) 推荐(0) 编辑

dp之完全背包 hdu--2159一维数组做法

摘要: #include <iostream>#include <stdio.h>#include <string.h>using namespace std;int main(){ int n,m,t,s; int dp[205]; int w[205]; int v[205]; int cnt[205] 阅读全文

posted @ 2017-06-20 13:44 chinacwj1 阅读(151) 评论(0) 推荐(0) 编辑

2017年6月19日

经典01背包

摘要: hdu 2602: 阅读全文

posted @ 2017-06-19 01:15 chinacwj1 阅读(120) 评论(0) 推荐(0) 编辑

dp水题

摘要: hdu 2084: 阅读全文

posted @ 2017-06-19 01:13 chinacwj1 阅读(150) 评论(0) 推荐(0) 编辑

2017年6月18日

SG函数

摘要: 关键: 找出子情况中,求出子情况未出现的最小正整数就是母情况的sg值,一般SG[0] = 0;(即当前人遇到0的情况时,他就已经输了,必败点),然后从这个点一直推出母问题的情况, 多堆,就用异或(^=) 代码实现(hdu 1848) 阅读全文

posted @ 2017-06-18 21:14 chinacwj1 阅读(278) 评论(0) 推荐(0) 编辑

上一页 1 ··· 3 4 5 6 7 8 下一页

导航