#CCBCHBA0000019. Đếm số ngoài đoạn (Count Values Outside Interval)
Đếm số ngoài đoạn (Count Values Outside Interval)
Count Values Outside Interval
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Count input values strictly outside the closed interval [L,R], i.e. xR. Values exactly equal to endpoints are inside.
Input
n in [0,100000]; integers L<R in [-1000000,1000000]; then n values in the same range.
Output
The count of values outside [L,R].
Subtasks
- Subtask 1 (20%): , .
- Subtask 2 (30%): , các trị tuyệt đối .
- Subtask 3 (50%): , các trị tuyệt đối .
Examples
Example 1
Input
4 2 5
1 2 5 6
Output
2
Explanation
Only 1 and 6 lie outside the interval; both endpoints are included.
Example 2
Input
0 -2 2
Output
0
Explanation
There are no values to examine.