Subarray queries

后端 未结 2 1171
青春惊慌失措
青春惊慌失措 2021-02-09 21:49

So I was trying to solve this programming problem.

Given an array of numbers and some queries. Each query gives you three numbers a,b,c and asks you to answer sum of all

2条回答
  •  执念已碎
    2021-02-09 22:20

    You can decompose it the other way around. Namely, build a tree of half-arrays (this is

提交回复
热议问题