登录
首页 » c++ » 基于线段树的同时快速维护区间乘法和区间加法

基于线段树的同时快速维护区间乘法和区间加法

于 2022-01-25 发布 文件大小:1.51 kB
0 20
下载积分: 2 下载次数: 1

代码说明:

主要就是要注意同时维护加法和乘法的lazytag时,加法和乘法的顺序会影响结果,如: x*2+3 != (x+3)*2 因此 维护其中一个tag时 要同时改变另一个tag 以免去顺序的影响。 因此有两种选择 先维护乘法 和 先维护加法 假设 x节点此时乘法tag是2 加法tag是3,之后获得了乘法tag4 以及加法tag5 先维护乘法: x=(x*2)+3 获得后:乘法tag*4 加法tag*4+5    x=(x*8)+3*4+5 先维护加法: x=(x+1.5)*2 显然涉及小数 有精度问题 不继续了 在确定先维护乘法后 就可以开始线段树了...

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • code
    说明:  对给定图片求图片中的染色体个数。具体步骤:中值滤波方法,二值化处理,膨胀和腐蚀,开闭运算,求连通区的个数(Of a given picture for the picture of the chromosome number. Concrete steps: median filter method, binarization processing, expansion and corrosion, opening and closing operations, and the number of connected areas)
    2008-11-26 14:27:43下载
    积分:1
  • sv22
    地震SV波的源代码,得出反射系数,透射系数,转换波的反射系数,透射系数等(SV wave seismic source code, come the reflection coefficient, transmission coefficient, reflection coefficient, transmission coefficient converted waves, etc.)
    2014-01-01 20:59:22下载
    积分:1
  • Dotion1807101823
    说明:  该程序编写了STM32F103三个串口初始化程序,可快速调用,同时支持接收和发送单个字符和多个字符,并存储数据,方便接收数据后的通信协议校验,支持自定义接收数据最大长度,重写printf函数。(Three initialization programs of STM32F103 serial port are written in this program, which can be called quickly, and support to receive and send single character and multiple characters at the same time, and store data, so as to facilitate the verification of communication protocol after receiving data, support to customize the maximum length of received data, and rewrite printf function.)
    2020-12-16 13:49:12下载
    积分:1
  • 通过datagrid和datalist来开发各种样式报表,值得一看。
    通过datagrid和datalist来开发各种样式报表,值得一看。-datalist through datagrid and the development of various forms of statements, an eye-catcher.
    2022-02-03 22:12:25下载
    积分:1
  • new-touchscreen
    HELLO HOW ARE YOU THIS SOURCE MSTAR IC.
    2013-07-11 12:58:16下载
    积分:1
  • 新建 360压缩 ZIP 文件
    说明:  广义s变换matlab程序以及使用例子,真实使用,下载即可。(Generalized S-transform matlab program and its application examples)
    2021-04-24 15:58:47下载
    积分:1
  • maoyigongsi
    贸易公司管理系统的源码: 具体包含:SQL语句 以及 C++下的源码(trading company management system source : specific include : SQL and C source code)
    2006-12-15 14:15:30下载
    积分:1
  • C#串口收发
    C#串口发送接收,刚开始也是菜鸟一名,WindowsFormsApplication2015控制和stm32进行通信控制
    2022-06-20 11:15:22下载
    积分:1
  • 9054-WDM-Driver
    Windows2000/xp下plx9054的pci驱动(源码、工程文件),支持DMA操作。 使用ddk开发,工程可以直接编译。(plx9054 Driver under Windows2000/XP. Developed by DDK.)
    2011-12-30 22:01:57下载
    积分:1
  • CN_edgedetect
    本程序为二值图像的处理。通过一种称为CNED(connectivity number based edge detection)的方法对二值图像进行边缘提取。结果表明这种方法比candy sober 等算子更加精确,效果更好。(This procedure for binary image processing. Through a known CNED (connectivity number based edge detection) method for binary image edge extraction. The results show that this method, such as candy sober than the operator more precise, better.)
    2007-04-22 13:23:27下载
    积分:1
  • 696518资源总数
  • 104224会员总数
  • 54今日下载