自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 资源 (1)
  • 收藏
  • 关注

原创 hdu 4436 str2int (SAM)

给n个只包含数字的字符串, 问这n个字符串能分解为多少种but

2014-10-31 22:01:13 778

原创 poj1509 Glass Beads sam

给一个循环的字符串。。 qiuchu

2014-10-31 16:53:00 479

原创 hdu4416 Good Article Good sentence(SAM)

题意:给一个字符串s, 然后再给n个串t1, 问

2014-10-30 21:44:55 574

原创 2014亚洲区域赛西安站总结

一场比较揪心的比赛。。

2014-10-29 00:49:58 847

原创 BestCoder Round #14 03 Harry And Math Teacher (线段树)

http://acm.hdu.edu.cn/showproblem.php?pid=5068题意:

2014-10-19 18:55:58 470

原创 (模板)dlx 精确覆盖和重复覆盖

精确覆盖#define mxn 1120#define N 1000200int n, m, t, size;int U[N], D[N], L[N], R[N], C[N], Row[N];int H[mxn], S[mxn];void init(int n, int m) { for(int i = 0; i <= m; ++i) { S[i] = 0, D[i] =

2014-10-15 11:26:05 1145

原创 (模板)逆元

int exgcd(int a, int b, int &x, int &y) { int d = a; if(b != 0) { d = exgcd(b, a % b, y, x); y -= a / b * x; } else x = 1, y = 0; return d;}int mod_inverse(int a, int m) { int x, y; exgcd

2014-10-14 21:45:45 655

原创 (模板) MCMF SPFA

struct edge { int u, v, cap, flow, cost, nxt; void set(int _u, int _v, int _cap, int _flow, int _cost, int _nxt) { u = _u, v = _v, cap = _cap, flow = _flow, cost = _cost, nxt = _nxt; }};struct

2014-10-14 21:34:27 1175

原创 (模板)isap

struct edge { int u, v, cap, flow, nxt; void set(int _u, int _v, int _cap, int _flow, int _nxt) { u = _u, v = _v, cap = _cap, flow = _flow, nxt = _nxt; }};struct isap { int n, s, t, fst[mxn],

2014-10-14 20:46:36 497

原创 (模板) dinic

#define mxn 100020#define mxe 200020#define inf 0x3f3f3f3fstruct edge { int u, v, cap, flow, nxt; void set(int _u, int _v, int _cap, int _flow, int _nxt) { u = _u, v = _v, cap = _cap, flow = _

2014-10-14 00:01:07 610

原创 (模板)米勒罗宾素数测试

LL prime[6] = {2, 3, 5, 233, 331};LL qpow(LL a, LL n, LL mod) { LL ret = 1; while(n) { if(n & 1) ret = ret * a % mod; a = a * a % mod; n >>= 1; } return ret;}bool Miller_Rabin(LL p) { if

2014-10-13 23:20:39 5946

原创 (模板)广义fib循环节

// f(n) = a * f(n - 1) + b * f(n - 2);// f(1) = c, f(2) = d // 可忽略// 求f(n)mod p循环节长度//c = a * a + 4b是模p的二次剩余时,枚举n = p - 1的因子// 否则 枚举n=(p+1)(p-1)的因子// 这里 p = 1000000007#include #include #in

2014-10-13 23:19:10 761

原创 (模板)Fib循环节

#include #include #include #include #include using namespace std;#define LL long longconst int M = 2;struct mat { LL a[M][M];};mat A, I = {1, 0, 0, 1};mat multi(mat a, mat b, LL mod) {

2014-10-13 23:18:36 529

原创 (模板)treap

struct node { int ch[2], r, v, s, cnt; node() {} node(int v):v(v) { ch[0] = ch[1] = 0, r = rand(), s = 1; cnt = 1; }}p[mxn*20];int sz;int creat(int v) { ++ sz; p[sz] = node(v); return sz

2014-10-13 23:14:39 568

原创 (模板)splay

#define mxn 200020#define ls (p[i].ch[0])#define rs (p[i].ch[1])struct node { int ch[2], val, s; void set(int x) { ch[0] = ch[1] = 0; val = x, s = 1; }}p[mxn];int sz;void down(int i){ //

2014-10-13 23:14:24 461

原创 (模板)后缀数组(lcp和rmq)

char s[mxn];int sa[mxn], t[mxn], t2[mxn], c[mxn], f[mxn][20], ft[mxn];int Rank[mxn], height[mxn];void get_sa(int m, int n) { //n = strlen(s) + 1; int i, *x = t, *y = t2; for(i = 0; i < m; ++i) c

2014-10-13 23:09:49 659

原创 (模板)AC自动机

struct trie { int ch[mxnode][26], lst[mxnode], cnt[mxnode], f[mxnode], sz; int creat() { memset(ch[sz], -1, sizeof(ch[sz])); cnt[sz] = 0; return sz++; } void init() { sz = 0, creat(); }

2014-10-13 23:09:24 499

原创 (模板)KMP

char t[mxn], s[mxn]; //t模板串,下标0开始int f[mxn], n;void get_f() { f[0] = f[1] = 0; for(int i = 1; t[i]; ++i) { int j = f[i]; while(j && t[i] != t[j]) j = f[j]; f[i+1] = t[i] == t[j]? j + 1: 0;

2014-10-13 23:08:54 444

原创 (模板)c++ 大数(正数加减乘除)

char ip[mxn];struct bign {    int len, dig[mxn];    bign() {        len = 0, dig[0] = 0;    }bool input() {        if(scanf("%s", ip) == EOF) return 0;        if(strcmp(ip, "0") == 0)

2014-10-13 23:06:07 944

原创 (模板)JAVA 大数的使用

import java.util.*;import java.math.*;public class Main { public static void main(String args[]) { int a = 102; BigInteger x = BigInteger.valueOf(a); Scanner cin = new Scanner(System.in);

2014-10-13 23:06:01 566

原创 ZOJ 3820 Building Fire Stations (二分)

题意:给一颗树, 每条边的权值都是1, 问选取两个点

2014-10-12 21:50:14 772

原创 acdream 1124 喵喵的遗憾 fib循环节

#include #include #include #include #include using namespace std;#define LL long longconst int M = 2;struct mat { LL a[M][M];};mat A, I = {1, 0, 0, 1};mat multi(mat a, mat b, LL mod) {

2014-10-08 22:04:03 677

2014国家集训队论文

2014国家集训队论文

2015-04-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除