![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树状数组
mizp
这个作者很懒,什么都没留下…
展开
-
Different Integers 树状数组(牛客)
题意: 给你一个数组,与m次询问,问在除(l,r)外的其他数总共有多少个不同的数思路: 这道题可以用莫队,玄学过,时间卡得非常紧,要是代码写丑了,常数稍微大一些,就TLE了另外一种方法:首先有一个小技巧可以把两段隔开的区间变成一段,我们可以在数组后面重复一次原数组,则a[n+i]=a[i],要求[1,l]与[r,n]变成求[r,n+l]然后我们接下来进行预处理pre[n]前n个数有多少个不...原创 2019-07-09 22:26:56 · 207 阅读 · 1 评论 -
Palindrome 字符串马拉车+树状数组 HDU6230
Palindrome题面: Alice like strings, especially long strings. For each string, she has a special evaluation system to judge how elegant the string is. She defines that a string S[ 1…3n−2 ] (n≥2) is one-...原创 2019-09-17 10:21:55 · 289 阅读 · 0 评论 -
Server 01分数规划+树状数组 HDU6240
Server题面: Alice and Bob are working on a new assignment. In this project, they need to access some information on a website and monitor this web site for consistent t days. In others words, in each d...原创 2019-09-17 10:55:13 · 274 阅读 · 0 评论