cswork / OA打开练习工作台

ZscalerOA #2

Signal Filter

估计简单可在线判题

考点(AI 标注)前缀和区间

A signal must fall within all closed intervals at once; count the frequencies that pass every filter.

See "Input" for the standard input/output conventions and constraints added by this site.

输入格式

n,m≤100000; frequencies and endpoints are 32-bit integers. Input n m, the frequencies, and m intervals.

输出格式

Output the number that pass.

样例 1

输入:

5 3
8 15 14 16 21
10 17
13 15
13 17

输出:

2

样例 2

输入:

3 2
0 10 20
-1 30
0 20

输出:

3

样例 3

输入:

3 1
1 2 3
4 9

输出:

0