上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 30 下一页

2014年11月20日

CodeForces 489F dp[][]

摘要: 将每列0和1数目切出来然后根据组合数来dp一直推到dp[0][0],即列有0个1的木有了,列有1个1的木有了== 1 #include 2 #include 3 long long dp[505][505],x[505][505]; 4 int main() 5 { 6 int n,m,i,... 阅读全文

posted @ 2014-11-20 16:02 xiao_xin 阅读(204) 评论(0) 推荐(0) 编辑

2014年11月9日

acm计划(更新于2014.11.9)

摘要: 下面有:1.要学习的知识:(主要) 图论:2-SAT,DLX,强联通tarjan,最小费用流 字符串:AC自动机 数据结构:划分树,伸展树spaly,动态树lct,主席树,平衡树treap,树的重心和直径 dp:概率dp及期望,插头dp 数论:高斯消元2.各个比赛要继续勇敢地被虐,为了未来... 阅读全文

posted @ 2014-11-09 16:41 xiao_xin 阅读(123) 评论(0) 推荐(0) 编辑

hdu5101 m个集合取任意不同集合两个数和大于k的方案:stl二分

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 #define LL long long 6 LL f[1005],a[1005][105],b[1000005]; 7 int main() 8 { 9 LL n,k,i,... 阅读全文

posted @ 2014-11-09 00:19 xiao_xin 阅读(118) 评论(0) 推荐(0) 编辑

hdu5102 单位边权树上的前k长路径和:队列技巧

摘要: 单向拓展边orz题解== 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int next[200005],head[200005],point[200005],now; 7 void add(int x,in... 阅读全文

posted @ 2014-11-09 00:14 xiao_xin 阅读(219) 评论(0) 推荐(0) 编辑

2014年11月8日

hdu3518 后缀数组标准模板:出现两次及以上子串数目

摘要: 字符串最后切记别忘了加上一个与前面不同的小标志!!然后此题还是利用height函数把每一个所枚举的长度为i的重复串个数计算出来,然后多少个不同的ans++ 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[200005]... 阅读全文

posted @ 2014-11-08 01:26 xiao_xin 阅读(112) 评论(0) 推荐(0) 编辑

2014年11月7日

hdu1403 后缀数组模板 求最长公共子串

摘要: 用一个未用过的字符连接两个字符串,求后缀数组相邻项来自不同穿的--最大height值即可。 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[200005]; 6 7 int sa[200005],t[200005],... 阅读全文

posted @ 2014-11-07 22:07 xiao_xin 阅读(95) 评论(0) 推荐(0) 编辑

hdu1573 中国剩余定理

摘要: 从爱神那看的中国剩余定理解法,挺容易理解的,就是一个循环迭代更新下去细节还是很重要! 1 #include 2 #include 3 #define LL long long 4 void exgcd(LL a,LL b,LL& d,LL &x,LL &y) 5 { 6 if (!b) {d... 阅读全文

posted @ 2014-11-07 12:13 xiao_xin 阅读(86) 评论(0) 推荐(0) 编辑

hdu4790 分别在两区间内各取一个数使模p为m的方案

摘要: 想到了用容斥简化题目,也想倒如何去算大区间的方案,最后对两个遗留串处理纠结了太久!!帅bin ac后我看了别人题解,真的只是细节讨论那儿处理的失误TAT哎自己傻逼又没写出来! 1 #include 2 #include 3 #include 4 using namespace std; 5 #def... 阅读全文

posted @ 2014-11-07 01:16 xiao_xin 阅读(115) 评论(0) 推荐(0) 编辑

2014年11月6日

hdu4786 生成树中1的个数为fibonacci数

摘要: 为什么在最小值和最大值之间就行,模模糊糊== 1 #include 2 #include 3 #include 4 using namespace std; 5 int father[100005],f[30]; 6 struct dian{ 7 int x,y,w; 8 }a[100005... 阅读全文

posted @ 2014-11-06 22:37 xiao_xin 阅读(91) 评论(0) 推荐(0) 编辑

hdu1452 积性函数(+逆元,快速幂)

摘要: 积性函数定义:f(1)=1,当a,b互质时f(ab)=f(a)f(b)。eg:1.f[n]:n的正因子个数 2.f[n]:n的正因子之和 3.gcd(n,k) k固定时n与k的最大公约数 4.φ(n) n的欧拉函数值(即小于n且与n互质数的数目)此题满足第二个,即可拆分成几个素数,然后用等比数... 阅读全文

posted @ 2014-11-06 16:16 xiao_xin 阅读(190) 评论(0) 推荐(0) 编辑

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 30 下一页

导航