ACM-数据结构
IBN5100
ACM若菜~
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Size Balanced Tree模板
#include #include #include using namespace std; const int maxn = 100001; int key[maxn],chd[maxn][2],siz[maxn],root,top; int new_node(int e,int s=1){ key[top]=e; chd[top][0]=chd[top][1]=0; siz[top]=原创 2013-10-11 18:11:45 · 674 阅读 · 0 评论 -
Treap模板
#include #include #include #include #include using namespace std; struct Node{ int key,w,cnt; Node *l,*r; Node(int key,int cnt){ this->key=key; this->cnt=cnt; this->w=rand(); } }; class Trea原创 2013-10-11 18:14:28 · 577 阅读 · 0 评论 -
hdu1512 二项堆
#include #include #include using namespace std; const int maxn = 100100; int key[maxn],lef[maxn],sib[maxn],cnt[maxn],fa[maxn]; int get_fa(int x){ int p=x; while(fa[x])x=fa[x]; while(p!=x){ int tm原创 2013-10-13 14:48:48 · 739 阅读 · 0 评论 -
zoj 3724 离线+线段树
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3724 这是道离线的好题! 首先,关于题意:现在有一个从1~n的n-1条有向边,其中i连向i+1,并且给出了这n-1条边的长度。除了这n-1条边之外,还有m条特殊的有向边。现在规定,特殊的边最多只能走一次。然后给出q组询问,问从u到v的最短路。 其中n 直接在原创 2013-11-26 13:18:57 · 928 阅读 · 0 评论
分享