NYOJ 522 Interval (树状数组) – 技术圈
Interval时间限制:2000 ms | 内存限制:65535 KB
难度:4
描述
There are n(1 <= n <= 100000) intervals [ai, bi] and m(1 <= m <= 100000) queries, -100000 <= ai <= bi <= 100000 are integers.
Each query contains an integer xi(-100000 <= x <= 100000). For each query, you should answer how many intervals covers xi.
输入
The first line of input is the number of test case.
For each test case,
two integers n m on the first line,
then n lines, each line contains two integers ai, bi;
then m lines, each line contains an integer xi.
输出
m lines, each line an integer, the number of intervals that covers xi.
样例输入
Read full article from NYOJ 522 Interval (树状数组) – 技术圈
No comments:
Post a Comment