上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: 1 void pre() 2 { 3 ine[1]=1; 4 for(int i=2;i<P;i++) 5 { 6 int a=P/i,b=P%i; 7 ine[i]=(ine[b]*(-a)%P+P)%P; 8 } 9 } 阅读全文
posted @ 2019-08-18 20:43 小布鞋 阅读(122) 评论(0) 推荐(0) 编辑
摘要: inline int read() { int x=0;char ch=getchar(); while(ch<'0'||ch>'9')ch=getchar(); while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x; } 阅读全文
posted @ 2019-08-18 20:43 小布鞋 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1 // Cease to struggle and you cease to live 2 // p4178 3 #include <iostream> 4 #include <cmath> 5 #include <cstdio> 6 #include <cstring> 7 #include < 阅读全文
posted @ 2019-08-18 20:42 小布鞋 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N=2e5+8; 4 int modd,n,m,rt,cnt=0,cnto=0; 5 int son[N],id[N],top[N],f[N],dep[N],siz[N],h[N 阅读全文
posted @ 2019-08-18 20:41 小布鞋 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N=4e4+8; 5 int n,all,mx,root,cntd=0,cnt=0; 6 ll ans=0,k; 7 int h[ 阅读全文
posted @ 2019-08-18 20:41 小布鞋 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1 //https://blog.csdn.net/jarjingx/article/details/8521690 2 //上面是讲解,下面是代码 3 //https://www.e-learn.cn/content/qita/1061337 4 //poj3648 5 //女2n男2n+1 6 #include<iostream> 7 #include<cstdio> 8 #include<c 阅读全文
posted @ 2019-08-18 20:40 小布鞋 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 哎,打多校题就是查自己算法的缺漏的。。。来学exkmp了,存存模板。 引用:https://www.jianshu.com/p/107e47994d49 感觉就是和kmp差不多,都是先自己匹配自己搞个数组,然后再模式串匹配文本串。 只不过kmp的数组是指i结尾的。 exkmp的extend[ i ] 阅读全文
posted @ 2019-08-14 14:38 小布鞋 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 打多校的题发现不会平衡树,来找到模板题做做。。。。 引用:https://blog.csdn.net/qq_38995588/article/details/80644655 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef lon 阅读全文
posted @ 2019-08-12 16:03 小布鞋 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 其实二维差分和一维差分一样,就是更新时一维是更新两个点,二维的更新四个点,然后询问某一个点的值都是前缀和。 这样子我就可以更新以(x1,y1)和(x2-1,y2-1)为两个对顶角的矩形, 然后最后要求前缀和 先求行的前缀和,再求列的前缀和 阅读全文
posted @ 2019-08-12 14:24 小布鞋 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 这题也是从白书上来的。 传送门:https://vjudge.net/problem/POJ-3729 题意:给你a、b串,让你求a串中有多少后缀与b串的所有后缀的公共前缀的长度最大值等于k。 借鉴:https://blog.csdn.net/lj94093/article/details/4470 阅读全文
posted @ 2019-08-10 10:58 小布鞋 阅读(196) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 下一页