摘要: P1531 I Hate It #include<bits/stdc++.h> using namespace std; const int SIZE = 2e5+5; int t[SIZE<<2],a[SIZE]; int n,m; void pushup(int i){ t[i]=max(t[i 阅读全文
posted @ 2022-05-03 16:59 蒟蒻xiezheyuan 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 阅读前 By Xie Zheyuan. 这里有一份 《线段树学习笔记》 AC代码索引 里面有AC代码。 若有谬误,敬请在评论区指出。 简介 线段树是一个维护区间信息的数据结构。只要信息维护满足结合律,就可以使用线段树。 基本思路 例题 下面的思路介绍以 P3372 【模板】线段树 1 为例。 如题, 阅读全文
posted @ 2022-05-03 11:31 蒟蒻xiezheyuan 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 题面 定义 \(F_i\) 为 斐波那契数列的第 \(i\) 项的数。你需要实现一个数据结构 \(a[]\),支持: 1 l r x:将 \([l,r]\) 的数加上 \(x\)。 2 l r:求 \(\sum\limits_{i=l}^{r}{F_{a[i]}}\)。 \(1 \le n,m \l 阅读全文
posted @ 2022-05-03 10:14 蒟蒻xiezheyuan 阅读(18) 评论(0) 推荐(0) 编辑