HBC15814Magnificent Tree题解 (it’suniversallyacknowledge)

天涯离梦残月幽梦 算法基础篇 39 0
不断提升技能,才能在职场中立于不败之地!全网最全C++题库,助您成为编程领域的佼佼者。
It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is a new leisure ground at the gate of HUST. The president of HUST wants to plant a group of trees on the ground and he wants the trees to be planted exactly like a square matrix. And then the gardens start their work. In the next N days, the gardens can water a tree in coordinate: and it makes the height of the tree grows H. Sometimes, the president wants to know how magnificent his trees are. The president will give the gardens two coordinates: , . The gardens should report the sum of the heights of the trees in the sub matrix represents by the two coordinates. There will be A days that the gardens will water a tree. And there will be Q days that the president will ask how magnificent his trees are. Apparently, N=A +Q. Furthermore, all the trees’ heights are 0 in the very beginning. All the absolute values of the inputs and the results are allnonnegative andwon't exceed 231-1.

It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is a new leisure ground at the gate of HUST. The president of HUST wants to plant a group of trees on the ground and he wants the trees to be planted exactly like a square matrix. And then the gardens start their work. In the next N days, the gardens can water a tree in coordinate: (x, y) and it makes the height of the tree grows H. Sometimes, the president wants to know how magnificent his trees are. The president will give the gardens two coordinates: (x1, y1), (x2, y2). The gardens should report the sum of the heights of the trees in the sub matrix represents by the two coordinates. There will be A days that the gardens will water a tree. And there will be Q days that the president will ask how magnificent his trees are. Apparently, N=A +Q. Furthermore, all the trees’ heights are 0 in the very beginning. All the absolute values of the inputs and the results are all nonnegative and won't exceed 231-1.

HBC15814Magnificent Tree题解
(it’suniversallyacknowledge)-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC15814Magnificent Tree题解