摘要:
题目链接:https://ac.nowcoder.com/acm/contest/95338/I 题意: 给定一个排列,共有m次查询,每次查询输入l,r,k三个参数,返回数组l~r排序后 数组之前下标为k的 元素 的 经过排序后的下标(每次查询独立,即不改变原数组) 思路: 时间复杂度需要nlogn 阅读全文
posted @ 2025-02-16 11:26
Marinaco
阅读(20)
评论(0)
推荐(0)
摘要:
两种操作时间复杂度O(logn),空间复杂度O(n) build方法 const int maxn=5e5+5; int n,m; int s[maxn]; void build(){ rep(i,1,n){ int x;cin>>x;change(i,x); } } lowbit方法(求x的最低位 阅读全文
posted @ 2025-02-16 09:56
Marinaco
阅读(10)
评论(0)
推荐(0)

浙公网安备 33010602011771号