树状数组
Healer66
他是谁啊?他究竟是什么身份啊?
展开
-
Kattis - prefixfreecode—E - Prefix Free Code (字典树&&树状数组)
链接:https://vjudge.net/contest/265795#problem/题意:给出 n个字符串,从中选出m个排列,问这m个字符构成的串在所有选出m个字符的排列中排第几。(类似康拓展开)思路:字符串排序,构造字典树并对每个单词标号,然后得到构成串的序列号,利用树状数组维护序列中某个位置的数后面有几个比他小的数。#include <bits/stdc+...原创 2018-10-28 09:33:47 · 356 阅读 · 0 评论 -
Gym - 102040F - Path Intersection (树链剖分)
类似 hdu3966#include <bits/stdc++.h>using namespace std;const int maxn = 10000+10;struct Edge{ int to,next;} edge[maxn*2];int head[maxn],tot;int top[maxn];int fa[maxn];int deep[max...原创 2019-08-12 18:55:00 · 418 阅读 · 0 评论