![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
weixin_44705665
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #590 (Div. 3) D - Distinct Characters Queries(单点修改+区间查询)
题目链接 题意: 给定一个字符串,可以进行两种操作: 1posc(1≤pos≤|s|,c是一个小写英文字母): 将第pos位换成c; 2lr(1≤l≤r≤|s|): 查找从l到r中不同字符的个数. 只对第二种情况输出结果。 思路: 用26位二进制表示26个英文字母,使用线段树进行或运算。 #include<bits/stdc++.h> using namesp...原创 2019-10-16 14:21:15 · 120 阅读 · 0 评论 -
HDU 1754 线段树区间最大值
很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<M<5000 )...原创 2019-08-09 11:06:17 · 84 阅读 · 0 评论 -
POJ 3468 线段树区间修改与区间和
You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the su...原创 2019-08-09 17:42:48 · 128 阅读 · 0 评论 -
HDU 1698 区间更新+区间求和(线段树)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. Now Pudge wa...原创 2019-08-10 10:55:07 · 83 阅读 · 0 评论 -
HDU 3074 单点修改+区间求积(线段树)
Tired of playing computer games, alpc23 is planning to play a game on numbers. Because plus and subtraction is too easy for this gay, he wants to do some multiplication in a number sequence. After pla...原创 2019-08-10 20:37:50 · 102 阅读 · 0 评论