- 博客(12)
- 资源 (2)
- 收藏
- 关注
原创 hdu1166 hdu1394 hdu2795
注意输入输出 线段树 单点更新 #include #include #include #include #include #include using namespace std; #define MAXN 50000 + 10 int n, val[MAXN]; struct Node { int l, r, sum; }node[MAXN << 2]; void
2014-04-21 18:23:20 470
原创 ac自动机模板
hdu2896 #include #include #include #include #include using namespace std; const int wl = 128; struct Node { Node *fail; Node *next[wl]; int counts, id; Node()
2014-04-08 20:31:47 423
原创 Kmp算法
/* 时间复杂度O(a.length() + b.length()) 最小覆盖字串(len - next[len - 1] - 1) */ void get_next(char* s) { next[0] = -1; for (int i = 1, j = -1; i < strlen(s); i++) { while (j >=
2014-04-08 20:30:26 395
原创 trie基本用法
问所给单词中是否有的单词有公共前缀 #include #include #include #include using namespace std; int n; char ch[10000 + 1][20]; struct Node { int next[10]; int num; }temp[100000 + 1]; bool ok; int num; voi
2014-04-05 15:44:29 752
原创 矩形将平面分割成了几个部分
#include #include #include #include using namespace std; #define MAXN 55 struct Node { int l, t, r, b; int x1, x2, y1, y2; }node[MAXN]; int dir[4][2] = {1, 0, 0, 1, -1,
2014-04-04 20:20:14 1300
原创 hdu4081 Qin Shi Huang's National Road System 最小生成树+DFS★★
用prime算法,kruscal 可能会超时 prime算法找路径的时候开辟一个数组记录路径。 #include #include #include #include #include using namespace std; #define MAXN 1000 + 1 #define inf 1e20 int n; bool vis[MAXN]; i
2014-04-01 22:00:52 462
原创 银行排队模拟
Baggage Room Time Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice SGU 363 Description Schoolboys Vasya and Pete travel a lot. They u
2014-04-01 12:39:00 835
简单五子棋c++
2013-12-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人