Farmer John has just arranged his N haybales at various points along the one-dimensional road running across his farm. To make sure they are spaced out appropriately, please help him answer Q queries , each asking for the number of haybales within a specific interval along the road.
Farmer John has just arranged his N haybales (1≤N≤100,000) at various points along the one-dimensional road running across his farm. To make sure they are spaced out appropriately, please help him answer Q queries (1≤Q≤100,000), each asking for the number of haybales within a specific interval along the road.
(图片来源网络,侵删)
标签: HBC24117小宝的旅游纪念品 线性dp 动态规划[USACO 2016 Dec S]Counting Haybales题解