POJ 3264 Balanced Lineup (线段树单点更新 区间查询)

For the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To keep things simple, he will take a contiguous range of cows from the milking lineup to play the game. However, for all the cows to have fun they should not differ too much in height.

Farmer John has made a list of Q (1 ≤ Q ≤ 200,000) potential groups of cows and their heights (1 ≤height ≤ 1,000,000). For each group, he wants your help to determine the difference in height between the shortest and the tallest cow in the group.

,昨晚多几分钟的准备,今天少几小时的麻烦。

POJ 3264 Balanced Lineup (线段树单点更新 区间查询)

相关文章:

你感兴趣的文章:

标签云: