POJ A Simple Problem with Integers
来源:互联网 发布:家里有蚂蚁 知乎 编辑:程序博客网 时间:2024/05/20 00:14
Description
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 of numbers in a given interval.
Input
The first line contains two numbers N and Q. 1 ≤ N,Q ≤ 100000.
The second line contains N numbers, the initial values of A1, A2, ... , AN. -1000000000 ≤ Ai ≤ 1000000000.
Each of the next Q lines represents an operation.
"C a b c" means adding c to each of Aa, Aa+1, ... , Ab. -10000 ≤ c ≤ 10000.
"Q a b" means querying the sum of Aa, Aa+1, ... , Ab.
Output
You need to answer all Q commands in order. One answer in a line.
Sample Input
10 51 2 3 4 5 6 7 8 9 10Q 4 4Q 1 10Q 2 4C 3 6 3Q 2 4
Sample Output
455915
Hint
分析:先放着。。。。。。自己先想想吧 反正是关键是那个啥。。。。
code:
- POJ A Simple Problem with Integers
- POJ 3468 A Simple Problem With Integers
- poj 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- POJ 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- POJ-3468-A Simple Problem with Integers
- POJ 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- POJ 3468 - A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- POJ 3468 A Simple Problem with Integers
- poj 3468 A Simple Problem with Integers
- POJ 3468 A Simple Problem with Integers
- 初学Linux(摘自百度知道和空间的资料)
- va_list
- VC/MFC给程序添加背景图片
- C ++的单例模式
- nginx源代码分析
- POJ A Simple Problem with Integers
- nginx 缓冲区构造
- 安装AdventureWorks、NorthWind 和Pubs示例数据库
- Nginx源代码分析 - 日志处理
- 浙大09年复试机试题目
- oracle存储过程
- freetype使用日记 -- 解决宋体,楷体中文在某些字号下无法正常显示的问题
- 验证数字的正则表达式集
- MFC中获取程序运行的路径