版本比较
线段树1.5题解: RN 离散化
正文
增加 2 行删除 2 行
11 行未改动12131415161718192021141 行未改动全部展开16316416516616716816917017193 行未改动11 行未改动# 前置知识[普通离散化(STL实现)](https://www.luogu.com.cn/problem/B3694),即用元素在序列中的排名(严格的)做为下标。先回顾普通离散化写法。1. 排序2. 去重3. 压入哈希表(可选)141 行未改动全部展开tree[c*2].ad+=tree[c].ad;tree[c*2+1].ad+=tree[c].ad;tree[c*2].dt+=tree[c].ad*tree[c*2].len;tree[c*2+1].dt+=tree[c].ad*tree[c*2+1].len;tree[c].ad=0;}void build(int l,int r,int c){if(l==r)93 行未改动11 行未改动12131415161718192021141 行未改动全部展开16316416516616716816917017193 行未改动11 行未改动# 前置知识[普通离散化(STL实现)](https://www.luogu.com.cn/problem/B3694),即用元素在序列中的排名(严格的)做为下标。先回顾普通离散化写法。1. 排序2. 去重3. 压入哈希表(可选)141 行未改动全部展开tree[c*2].ad+=tree[c].ad;tree[c*2+1].ad+=tree[c].ad;tree[c*2].dt+=tree[c].ad*tree[c*2].len;tree[c*2+1].dt+=tree[c].ad*tree[c*2+1].len;tree[c].ad=0;}void build(int l,int r,int c){if(l==r)93 行未改动