数据结构
文章平均质量分 66
renxinyu2002
虽然我们走不了最短路,但图依然是连通图
展开
-
复习 队列安排 链表
#include #include #include #include using namespace std; const int maxn=1e5+10; int p[maxn],nxt[maxn],vis[maxn]; int main(){ int n; scanf("%d",&n); int k,pp; p[1]=0; nxt[0原创 2017-10-29 22:23:41 · 215 阅读 · 0 评论 -
线段树模板
// 第一个线段树,背一背 #include #include #include #include using namespace std; const int maxn=100010; int n,m,a[maxn],s[maxn],c[maxn]; void push(int rt){ s[rt]=s[rt } void build(int l,int r,i原创 2017-10-30 19:07:13 · 161 阅读 · 0 评论 -
合并果子(堆模板)
#include #include #include #include using namespace std; const int maxn=1e5+10; int cnt,h[maxn],a[maxn],n; void put(int x){ h[++cnt]=x; int now=cnt,nxt; while(now>1){原创 2017-11-03 12:39:14 · 418 阅读 · 0 评论