HDU - 4578 线段树+三重操作】的更多相关文章

这道题自己写了很久,还是没写出来,也看了很多题解,感觉多数还是看的迷迷糊糊,最后面看到一篇大佬的才感觉恍然大悟. 先上一篇大佬的题解:https://blog.csdn.net/aqa2037299560/article/details/82872866?tdsourcetag=s_pcqq_aiomsg  (既简单又高效 代码还短!%%%) 先说下题意: 就是给你n个数,每个数的初始值都是为0 然后给你m个操作 每个操作有 4 个数  op x y c 当 op==1 的时候,把 x到y 范围…
Transformation Time Limit: 15000/8000 MS (Java/Others)    Memory Limit: 65535/65536 K (Java/Others) Total Submission(s): 4095    Accepted Submission(s): 1008 Problem Description Yuanfang is puzzled with the question below:  There are n integers, a1,…
Memory Control Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5913    Accepted Submission(s): 1380 Problem Description Memory units are numbered from 1 up to N. A sequence of memory units is c…
Transformation 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=4578 Problem Description Yuanfang is puzzled with the question below: There are n integers, a1, a2, -, an. The initial values of them are 0. There are four kinds of operations. Operation 1…
题目大意: 题意:有一个序列,有四种操作: 1:区间[l,r]内的数全部加c. 2:区间[l,r]内的数全部乘c. 3:区间[l,r]内的数全部初始为c. 4:询问区间[l,r]内所有数的P次方之和. 这里p可以等于1,2,3三种情况,所以我们需要建立3个数组,当然这里其实只用一个sum[4*N][3]的2维数组其实更好 to[],add[],mul[]为三个懒惰标记to[]先于另外两个,每次做完to[],另外两个标记就要将其初始化 对于mul[]来说,每次执行,add[cur]*=mul[cu…
链接:点我  1…
题意:区间  加   变成定值 乘  区间查询:和 平方和 立方和 思路:超级超级超级麻烦的一道题  设3个Lazy 标记分别为  change 改变mul乘 add加  优先度change>mul>add因为改变了之后 前面的mul 和add都失效了 push_down的时候    如果有change 标记 可以很方便得求p[1] p[2] p[3] 如果mul存在  则也可以很方便求得子区间的各种值 同时由于mul 比add优先  要把add标记*=value  相当于本来每个加5  乘以…
Queue-jumpers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3348    Accepted Submission(s): 904 Problem Description Ponyo and Garfield are waiting outside the box-office for their favorite mo…
Assign the task Time Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1647    Accepted Submission(s): 753 Problem Description There is a company that has N employees(numbered from 1 to N),every emplo…
Sequence operation Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7502    Accepted Submission(s): 2233 Problem Description lxhgww got a sequence contains n characters which are all '0's or '1…