当前位置: 首页 > 网络知识

[luoguP1168]中位数(主席树+离散化)

时间:2026-01-29 09:27:59

传送门

模板题一道,1A。

——代码

1 #include <cstdio> 2 #include <algorithm> 3 #define ls son[now][0], l, mid 4 #define rs son[now][1], mid + 1, r 5 6 using namespace std; 7 8 const int N = 100005; 9 10 int n, sz, tot; 11 int a[N], b[N], sum[20 * N], rt[20 * N], son[20 * N][2]; 12 13 inline void build(int &now, int l, int r) 14 21 22 inline void update(int &now, int l, int r, int last, int x) 23 33 34 inline int query(int now, int l, int r, int x) 35 41 42 int main() 43 56 return 0; 57 }
View Code



上一篇:[luoguP2420] 让我们异或吧(dfs + 异或的性质)
下一篇:[luoguP1027] Car的旅行路线(Floyd)
离散化 主席树
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器
  • 英特尔第五代 Xeon CPU 来了:详细信息和行业反应
  • 由于云计算放缓引发扩张担忧,甲骨文股价暴跌
  • Web开发状况报告详细介绍可组合架构的优点
  • 如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳
  • 美光在数据中心需求增长后给出了强有力的预测
  • 2027服务器市场价值将接近1960亿美元
  • 生成式人工智能的下一步是什么?
  • 分享在外部存储上安装Ubuntu的5种方法技巧
  • 全球数据中心发展的关键考虑因素
  • 英特尔与 Vertiv 合作开发液冷 AI 处理器

    英特尔第五代 Xeon CPU 来了:详细信息和行业反应

    由于云计算放缓引发扩张担忧,甲骨文股价暴跌

    Web开发状况报告详细介绍可组合架构的优点

    如何使用 PowerShell 的 Get-Date Cmdlet 创建时间戳

    美光在数据中心需求增长后给出了强有力的预测

    2027服务器市场价值将接近1960亿美元

    生成式人工智能的下一步是什么?

    分享在外部存储上安装Ubuntu的5种方法技巧

    全球数据中心发展的关键考虑因素