随笔分类 - 树-线段树
摘要:A题 原CF 438D The Child and Sequence 题意 给一串数字,m次操作,1.区间查询;2.区间取模;3.单点修改 基本思路 考虑到模如果大于区间的最大值,则取模没有意义。若小于则向下查询并修改,考虑到一个数每次取模最多为原数的,则可认为修改次数不超过$\log{2
阅读全文
摘要:```c++ include using namespace std; typedef long long ll; typedef struct{ ll l,r,w,f; }Node; Node nodes[1000000]={0,0,0}; ll x,y,ans,mod,single; void
阅读全文
摘要:```c++ include using namespace std; typedef struct{ int l,r,w; }Node; Node nodes[1000000]={0,0,0}; int x,y,ans,mod,single; void build(int l,int r,int
阅读全文