寒江陪烟火🔥
寒江陪烟火🔥
全部文章
简单模版
acm相关(6)
dp(68)
RMQ(5)
STL(6)
主席树(2)
二分匹配(23)
二分查找(2)
分治法(3)
划分树(1)
单调队列(2)
博弈(11)
字典树(3)
字符串处理(1)
学习(1)
并查集(4)
强联通分量(3)
归并排序(1)
拓扑排序(1)
搜索(1)
数论(8)
最小生成树(3)
最短路(5)
树状数组(7)
树链剖分(4)
欧拉回路(5)
简单题(24)
线段树(13)
网络流(6)
归档
标签
去牛客网
登录
/
注册
寒江陪烟火🔥的博客
全部文章
/ 简单模版
(共14篇)
卡特兰数及其扩展
普通(n==m):c(n*2,n)/(n+1) 扩展(n>m):(n-m+1)/(n+1)*c(n+m,n)
2016-11-05
0
259
最小表示法
int work(int m,int p[]) { int i,j,l; i=0;j=1; while(i<m&&j<m) { for(l=0;l<m;l++) if(p[(i+l)%m]!=p[(j+l)%m]) b...
2016-11-04
0
214
求1——10^x-1各个位置的和
求1——10^x的各位和=45*x*10^(x-1) 如求1——10^18的各位和=45*18*10^17
2016-11-03
0
222
hdu5901 Count primes(大素数模版)
题意: 1——n(10^11)的素数个数 思路: 参考:http://blog.csdn.net/chaiwenjun000/article/details/52589457 第一个O(n^(3/4)) /* *************************************...
2016-09-21
0
226
组合数取模
参考:http://blog.csdn.net/acdreamers/article/details/8037918 NM较小 const int N = 1e6+5; const int mod = 1e9+7; int f[N]; int inv(int x) { ...
2016-09-20
0
275
快速乘法模版(quick_mul)
就是把快速幂*改了+ 这样就解决了乘法暴LL的问题了 LL quick_mul(LL aa,LL bb,LL mod) { aa%=mod; LL ret=0; while(bb) { if(bb&1) ret=(ret+aa)%mo...
2016-07-28
0
190
POJ3070 Fibonacci(矩阵快速幂)
用矩阵快速幂求fibonacci序列的第n项。 /* *********************************************** Author :devil Created Time :2016/1/19 20:11:43 ****************...
2016-01-19
0
225
组合数打表
long long c[105][105]; void init() { for(int i=0; i<=50; i++) c[i][0] = 1,c[i][i] = 1; for(int i=1; i<=50; i++) for(int j=1; j&l...
2016-01-19
0
217
输入挂(读数大致格式)
void read(int &x) { char c; while((c=getchar())<'0' || c>'9'); x=c-'0'; while((c=getchar())>='0' && c<='9') x=...
2015-10-10
0
242
大数模版
#include <iostream> #include <cstring> using namespace std; #define DIGIT 4 //四位隔开,即万进制 #define DEPTH 10000 ...
2015-09-26
0
226
首页
上一页
1
2
下一页
末页