随笔分类 - 数据结构~主席树
摘要: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
阅读全文
摘要:#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
阅读全文
摘要: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
阅读全文

浙公网安备 33010602011771号