
线段树
coding__girl
这个作者很懒,什么都没留下…
展开
-
poj 3468 A Simple Problem with Integers
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 sum原创 2017-10-14 21:40:47 · 194 阅读 · 0 评论 -
poj 2352 Stars
题意: 在坐标上有n个星星,如果某个星星左下位置有a个星星,就表示这个星星属于level a 星星坐标输入按照y递增,如果y相同则x递增,求出所有level水平的星星数量#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int Maxn=32005;const int N=1原创 2017-10-14 22:06:24 · 182 阅读 · 0 评论 -
算法训练 操作格子
问题描述 有n个格子,从左到右放成一排,编号为1-n。共有m次操作,有3种操作类型:1.修改一个格子的权值,2.求连续一段格子权值和,3.求连续一段格子的最大值。对于每个2、3操作输出你所求出的结果。输入格式 第一行2个整数n,m。接下来一行n个整数表示n个格子的初始权值。接下来m行,每行3个整数p,x,y,p表示操作类型,p=1时表示修改格子x的权值为y,p=原创 2018-02-05 18:24:21 · 221 阅读 · 0 评论