随笔分类 -  数据结构~主席树

摘要:https://vjudge.net/problem/SPOJ-COT 思路:我们对于每个节点都在它父亲上建主席树,因为具有前缀和性质,我们在求树上两点时u->v,它这个区间的值是T[T[y].l].sum+T[T[x].l].sum-T[T[lca].l].sum-T[T[falca].l].su 阅读全文
posted @ 2019-05-22 20:44 MengX 阅读(312) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+5; int n,m,cnt,tot,root[N]; ll ans1,ans2,ans3; char s[20]; struct n 阅读全文
posted @ 2019-05-21 21:58 MengX 阅读(276) 评论(0) 推荐(0)
摘要:Super Mario Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble 阅读全文
posted @ 2018-05-29 14:39 MengX 阅读(182) 评论(0) 推荐(0)

梦想不是空想