DMOPC '19 Contest 2 P0 - Roller Coaster

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

You are working at an amusement park roller coaster. There is a line of N incoming children. However, each person needs to be at least height H_{min} and at most H_{max} for safety reasons. Given the heights of each child, h_1,h_2,h_3,\dots,h_N, count the number of children who can go on the ride. N, H_{min}, H_{max}, h_i are natural numbers.


In all tests,
1 \le N \le 10^5
1 \le H_{min} \le H_{max} \le 10^6
1 \le h_i \le 2\times10^6

Input Specification

The first line contains three numbers separated by spaces: N, H_{min}, H_{max} the number of children in line, minimum height, and maximum height, respectively.
The second line contains N numbers separated by spaces, the height of each child: h_1,h_2,h_3,\dots,h_N.

Output Specification

Output on a single line, the total number of children who can go on the roller coaster.

Sample Input

10 7 12
2 4 1 7 8 10 11 3 9 6

Sample Output



There are no comments at the moment.